Copy link to clipboard
Copied
Is there a way to enter document level Javascript into a PDF when exporting from InDesign?
Copy link to clipboard
Copied
No. InDesign's native DOM does not have access to the contents of a PDF as it is in progress of being exported, and through JavaScript you can only pretty much do what InDesign itself already can do on its own, with very few exceptions.
It is conceivable that a custom native plug-in might be able to pull this off, but as an educated guess I'd state that is rather unlikely. "Breaking in" the exporting document to inject custom data sounds impossible, so it would need to be a total replacement of the entire PDF export process.
(Another approach, breaking in to the PDF after creating it and then add a few custom objects also sounds "remotely possible but unlikely to be practical". As it is, InDesign's ancient version of JavaScript is not really suitable for such pranks.)
If you think it might be a useful addition for a larger number of users, you could post a Feature Request: Adobe InDesign: Feature Requests: Top (2368 ideas) – Adobe InDesign Feedback
Copy link to clipboard
Copied
Not that I am aware. You can RUN scripts, but any JS would be applied as form actions in a pdf.
-Dax
Copy link to clipboard
Copied
No. At least not if you export to PDF.
A chance to do that ( I did not try this for more than 10 years and it changed a lot with the security features in Acrobat since then 😞
Print to PostScript and distill to PDF.
You should be able to slip in a special set of instructions that comes with a placed EPS file that contains pdfmark annotations that itself contain some JavaScript that could be executed with Acrobat Pro or Adobe Reader. If the user allows this.
If you have access to the book "Die PDF & PostScript Bibel" from the 90s by Thomas Merz and Olaf Drümmer see chapter:
"11.8 JavaScript mit pdfmarks"
Some references you might need:
https://www.adobe.com/content/dam/acom/en/devnet/acrobat/pdfs/pdfmark_reference.pdf
https://www.adobe.com/content/dam/acom/en/devnet/actionscript/articles/5002.EPSF_Spec.pdf
https://www.adobe.com/content/dam/acom/en/devnet/actionscript/articles/PLRM.pdf
Regards,
Uwe
Find more inspiration, events, and resources on the new Adobe Community
Explore Now