Hi,
I have a difficult problem, I'm sure it'll be quite a challenge even to the JS experts around here:
I have an image on a page (logo). I make a call using SOAP to my webservice to get the logo content (the binary data of the gif file).
My problem is that although I have the data (either as a string or as a stream), I cannot assign it to the existing picture and force it to render. Can I create one dynamically in Acrobat Reader? Or do you have any idea how I can use the existing blank picture which was reserved for this purpose to be assigned with the new picture data?
Thanks in advance,
Eyal.
However, given that you have already built a web service, you have another option. Use a server side script to return the image in an FDF through an HTTP Response. The "doc.submitForm()" method uses HTTP Req/Resp to communcate with a server script. You can use this mechanism to return an FDF to the PDF. Button images can be populated through an FDF.
To see how this works, place a button on a PDF and place an image in it. Then export an FDF to your local drive. Change the image and do it again, only save the FDF to a different name. Then, when the FDF is imported it sets the button image. Look in the FDF file to see how it's all formatted. The specifics are give in the PDF Specification, which you can download from here. In fact, it'd probably be a good idea to download the Acrobat SDK.
http://www.adobe.com/devnet/acrobat/
This is much, much easier than using a web service.
Thom Parker
The source for PDF Scripting Info
www.pdfscripting.com
Very Important - How to Debug Your Script