Copy link to clipboard
Copied
How do I make a button (javascript) with InDesign to insert a photo in a pdf with a certain width and height and in Layer 1 (pdf has two layers)
<Title renamed by moderator>
Short answer: You don't.
Longer answer: Ask in the Acrobat forum. Hopefully, someone can help you there but be aware, if you can't control the application that will open this PDF, don't bother. It will fail on most readers.
Copy link to clipboard
Copied
Short answer: You don't.
Longer answer: Ask in the Acrobat forum. Hopefully, someone can help you there but be aware, if you can't control the application that will open this PDF, don't bother. It will fail on most readers.
Copy link to clipboard
Copied
InDesign does not have access to all interactive features, but as Bob says, the PDF reader will limit functionality.
Or maybe I'm missunderstanding do you want InDesign to place the image a specific size and layer Layer 1? Need to understand better what you are trying to achieve. If it is a PDF with rich functionality I would (as Bob says) suggest PDF forum (Knowing that you are asking for alot with too many unknowns).
Copy link to clipboard
Copied
Hi Arno,
It can't be done natively in InDesign.
However, it can be done with FormMaker (https://www.id-extras.com/products/formmaker/), an InDesign add-on I've developed. FormMaker is not free, but for short, 1-page forms, there is a free version.
The way you'd do it in FormMaker is as follows:
(1) Draw a rectangle in InDesign on the layer you want. Its size should be the size of the final image.
(2) Convert that rectangle into a button in the Buttons and Forms panel in InDesign:
(3) In FormMaker, select the rectangle and add a mouse-up Javascript to it (mouse-up is essentially the same as clicking on the rectangle):
(4) The Javascript you need is a single line of code: event.target.buttonImportIcon();
(5) Click on the "Create Interactive PDF" button in FormMaker to create the form. Run the FormMaker command in Acrobat (at the bottom of the edit menu) and voila! When the user clicks the button, they will be able to select an image to display in the rectangle you have created.
Not all PDF readers support these actions. However, the free Adobe Reader certainly does, as does Foxit Reader, and probably several others.
Creating an interactive PDF in this way can be a very convenient way of letting the end-user customize your designed PDF. (E.g., if you're designing a generic birthday card, you could let the user select a picture of the birthday boy or girl, and print it out.)