Hi,
I am working on PDFs, what I do is the following:
I take a PDF extract the text, do a lot of annotating add the annotations as colored layers onto the PDF which leaves me with a PDF that has colored annotated text areas that you can click and a app.popUPMenuEx() is opened where additional Information can be found regarding this annotation. This workflow is basically a java program, so everything is automated, I don't use AdobeAcrobatPro or something.
The popUp is done with Javascript. All this works fine but now I have a kind of annotation that needs an image as additional information.
So my question is the following: How do I get an image.png file, that is generated while the annotations are made (thus I know its location) into the PDF? Can I directly load images via javascript, using the images URI? Or do I have to first get this image into the pdf document (which is the worst case) I dont want the image to be inside the PDF. I already figured out by reading this forum, that a buttonField is maybe what I am looking for, however therefore my image needs to be an Icon, whatever this is...
Anyways, any hint or help is really appreciated.
Thanks,
Alex
Importing a remote image is difficult, but doable. You can in fact load an image through an FDF file. To see how this works use Acrobat Pro to put an image on a button, then export an FDF file with a script and explicitly specifying the button name, like this.
this.exportAsFDF({aFields:"Button1"});
Open the FDF file in a binary editor and you'll see how the image data is formatted. It follows the standard PDF Image XObject structure.
When this same FDF file is loaded into the PDF it will load the image into the button.
Thom Parker
The source for PDF Scripting Info
www.pdfscripting.com
Very Important - How to Debug Your Script