Copy link to clipboard
Copied
Hi,
Is there a way to use Javascript to insert an image into a PDF?
It would be something along the lines of:
Insert image from C:\Images\image.png...
and then the image would hover by the cursor to then be placed in the PDF.
I can use the image insert button, but I want to skip the step of choosing a file.
I regularly insert the same file into PDFs and it would be quicker to go straight to that image.
Thanks.
Copy link to clipboard
Copied
You can use a stamp for this.
Copy link to clipboard
Copied
Copy link to clipboard
Copied
You can add text on top of a button image or a stamp, you just can't do it externally (unless flattened), it has to be done in that object (i.e. button or stamp). How much text do you need to place over the image?
Copy link to clipboard
Copied
Copy link to clipboard
Copied
You can use a dynamic stamp.
Copy link to clipboard
Copied
You can read some about dynamic stamps here, watch the free videos.
https://www.pdfscripting.com/public/All_About_PDF_Stamps.cfm
Copy link to clipboard
Copied
> and then the image would hover by the cursor to then be placed in the PDF.
This part is not possible, but the rest is. You can use a stamp, as mentioned, or a button field, or even insert it as a watermark. The latter will allow you to add text on top of it, but it's the more difficult one to place.
If you add it as a stamp or a button field you can then flatten the page and add text on top.
Copy link to clipboard
Copied
Just curious, why are you considering only the use of stamps in this workflow?
Does the users of the form require to to have the freedom to place an image in whatever part of that document, or will this image be located always in a precise location?
Copy link to clipboard
Copied
Copy link to clipboard
Copied
You'll find a video here which covers everything you'll ever want to know about the stamp name and several ways to find and change it.
BTW: the last line of your code won't work in Reader, and will cause the script to fail because the "info" property can't be changed on that platform.