These forums are now Read Only. If you have an Acrobat question, ask questions and get help from one of our experts.

Adding dowload Link to an Image with JavaScript

kelenyo
Registered: Aug 25 2009
Posts: 4

Hi everyone,

Can some one help me?

I have a Pdf file with image and I want insert the possibility to save a image when one click on it. That means the image should be like a link and one click on it he receive the possibiblity to save the image on the PC.
How ca I do that with JavaScript?

Thanks

Kelen-Yo

My Product Information:
Acrobat Pro 8.1.6, Windows
try67
Expert
Registered: Oct 30 2008
Posts: 2398
It's a bit complicated, but you can do it if you attach the image to the PDF and then use the exportDataObject method.

- AcrobatUsers Community Expert - Contact me personally at try6767 [at] gmail [dot] com
Check out my custom-made scripts website: http://try67.blogspot.com

kelenyo
Registered: Aug 25 2009
Posts: 4
Hi

Thank for the suggestion. The question now is how to attach image that can be download by clicking on it?

Kelen-Yo
try67
Expert
Registered: Oct 30 2008
Posts: 2398
I understood the question and I provided you with the way to do it.
You can't export the image itself with JavaScript since it has no access to it. The closest you can get is if you attach the image as a file to the PDF and then export that.
Otherwise you need a plugin.

- AcrobatUsers Community Expert - Contact me personally at try6767 [at] gmail [dot] com
Check out my custom-made scripts website: http://try67.blogspot.com