Drawing to existing PDF - iphone

When i did CGContextCreateWithURl(url) it created empty context even though i passed url of existing file. How to get the context of existing PDF file?

From my experience you can't actually draw directly to an existing pdf:
Convert pdf to image
Draw new content to that image
Convert appended image to pdf
Not the smoothest, but it works.

the URL isn't an input. It's where you want the context to write the resulting PDF to.
From the documentation:
url
A Core Foundation URL that specifies where you want to place the resulting PDF file.

Related

How to add an image to a pdf using Capacitor pdf-generator plugin

I’m using capacitor pdf-generator plugin to create a pdf. I managed to do so as long as the html code is limited to non image tag, code in which I inject some dynamic data by nesting variable using ${ }.
Now, my aim is to bind the src attribute of an ```img`` tag to a variable so that I can change the logo displayed in the created PDF.
Where I fail: what appears on the PDF is a white space with dashed borders (check picture attached). So I guess that the path must be correct because if not it would show the missing icon (issue I went through before I could format correctly the path).
Anyone who already had that trouble?
Finally bypassed this issue by storing the base64 data when selecting a logo and using it directly in the img tag.
<img src="data:image/png;base64,${base64data} " />
You can convert the images to base64 here https://www.base64-image.de/
then add the codes directly to your image tag

tinyMCE - is it possible to prevent the cut and paste of images (base64) in the textbox?

TinyMCE 4: I have implemented the image file/upload from local source, using php to save the uploaded file into a directory, with tinyMCE referencing this image. Works fine. This leaves a simple html text file to save in the database.
However, I see that the user can just cut and paste an image directly into the textbox, resulting in the image showing up and becoming a base64 image string, which defeats the purpose of storing only html text. Now the text could become extremely long if this base64 image is not prevented.
Is there a way to prevent this image paste action in tinyMCE? Or better yet, a way to automatically convert this paste into an image file and have it stored in the same place as the other images on the fly?
I know I could convert base64 images to a jpg files and store after submitting the form to a php handler, but would seek a simpler answer if possible.
The documentation is your friend for this issue. TinyMCE can certainly help you convert the images on the fly as they are pasted into the editor:
https://www.tinymce.com/docs/advanced/handle-async-image-uploads/
You can also stop the images from appearing in the first place if that is your preference:
https://www.tinymce.com/docs/plugins/paste/#paste_data_images

How to setup ImageTools in TinyMce

I have added a ImagePlugin as described in https://www.tinymce.com/docs/plugins/imagetools/#sdkinstallation.
I can modify a photo in an editor but I don't know how to save it after modifications.
After posting a form with wysiwyg I get :
Cannot convert
blob:http://10.48.200.155/5e32b981-6e33-48cc-87b1-512abd653912 to
Blob. Resource might not exist or is inaccessible.
When you use the image editing tools to modify an image the editor creates a Base64 encoded new image. This exists (right after the editing) only in the browser. To permanently save the image to something other than Base64 you need to follow these instructions:
https://www.tinymce.com/docs/advanced/handle-async-image-uploads/
The net is that the editor can be configured to send the image binary to a script of your choice. That script needs to save the image somewhere appropriate and return JSON with the path to the new image's location.

JasperReports: PDF generation with image from database

I want generate PDF File with an image. The image name from database and physically the image is present inside local drive or remote server. I want to pass image name to the PDF.
Currently I am doing this by put an image element inside the iReport IDE designer and pass the server path or local drive path to that image.
It works fine. But I need some other type for dynamic images.
If the image can be reached by the app with a URL you can add a paramter named IMAGE_SRC, and specify in the iReport designer
image expression: new java.net.URL($P{IMAGE_SRC})
expression class: java.net.URL
for the image. Then at runtime you will fill the report after setting the parameter IMAGE_SRC with the value readed from the database

Adding annotation in Pdf

How can I add annotation to an existing pdf file? I saw libHaru library.But it doesn't allow editing existing file. How can i overcome it?
After running into this issue recently, I had to piece together a few ideas to make it work.
A few questions:
What type of annotation are you doing?
Do you have a png file of the pdf?
What are you doing with the file after it is appended?
Hi-level:
Convert pdf to image file either programmatically or before adding to the bundle.
Have appending done and saved on another layer of the view (OpenGL as an example).
Merge/Combine the two image layers.
Draw new combined image pdf.