Using Javascript inside a PDF

Where can I find documentation on running Javascript inside a PDF?

I have never added javascript action inside a PDF. However, I have done quite a lot of web development using javascript. I have a few questions for someone familiar with javascript inside a PDF.

NitroPDF and Adobe Acrobat definitely support javascript in PDF files. Is there a standard for the various objects that exist and function to control pdf through javascript? All that I have found so far was from Adobe. Anywhere else seems to be accessing Adobe documents. Is there a standard, or is Adobe a de facto standard?

Also, do all PDFs support javascript actions?

The best documents on using javascript inside a pdf document that I could find were obtained from Adobe - Adobe :: Acrobat Javascript Scripting Guide .

NitroPDF has this link - NitroPDF :: Javascript in PDF files , but basically just says it supports what Adobe has.

I also found this link from Scribus - Scribus :: How to improve your PDF forms using JavaScript , but that includes a few small snippets of code. Nothing super useful.

Adobe has documents on how you can set breakpoints, etc. for javascript using their IDE. Is it possible to run javascript in pdf using a different IDE and have breakpoints, etc. ?? It would be great to find something as cool as Firebug .

Note:

Please do not respond how to manipulate a PDF file that is loaded in a web browser. It's about running javascript from a PDF document. I am trying to explore the features available with javascript in a PDF document. In particular, I can use the quickpdflibrary functions to add javascript functionality to existing documents.

Edit

Another useful link: Development with Acrobat Javascript . Apparently, js in PDFs is often called AcroJS or Acrobat JavaScript.

+58
javascript pdf documentation acrobat pdf-manipulation
09 Feb '12 at 22:26
source share
5 answers

You may be looking for JavaScript ™ for the Acrobat® API Reference .

This link should be the most complete. But, as @Orbling said, not all PDF readers can support the entire API.

EDIT:

It turned out that new versions of links appeared in the Acrobat SDK (thanks to @jss).

The Acrobat Developer Center contains links to various versions of the documentation. The current version of the JavaScript link from the Acrobat DC SDK is also available there.

+22
Feb 10 2018-12-12T00:
source share

I'm sure this is the Adobe standard, keeping in mind that the entire PDF standard is their beginning; despite being open now.

My guess would not be for all readers supporting it in PDF format, as some will definitely not have a JS engine. I doubt that you can rely on full support beyond the latest versions of Acrobat (Reader). So, I think it depends on how you think it is used, if mainly with a browser, then most of the market is served by Acrobat (Reader) and the Chrome browser built-in - unless there is documentation about whether there is a Chrome PDF viewer fully supports JS.

+3
Feb 09 '12 at 22:33
source share

The public place for JavaScript documentation in Acrobat is the Acrobat SDK, which can be downloaded from the Adobe website. In the "Documentation" section, you will find all the materials needed to work with Acrobat JavaScript.

To complete the documentation, you can additionally get the JavaScript Core specification. My book for this is David Flanagan's “JavaScript Ultimate Guide,” published by O'Reilly.

+3
Mar 30 '14 at 12:27
source share

Look for books by Ted Padova . Over the years, he has written a series of books called The Acrobat PDF {5,6,7,8,9 ...} Bible. They contain Javascript chapters in PDF files. They are not as complete as the referenced documents listed here, but there are some realistic use cases discussed in the books in the books.

There was also talk about hacking PDF files by female computer scientists, which was given at a conference in 2010. the link to the slide announcement announcement page is dead, but Google is your friend. However, this is not just about javascript. Youtube video : JS starts at 06:00

+1
Dec 14 '12 at 12:36
source share

here you can find "Adobe Acrobat Forms JavaScript Object Specification Version 4.0" Revised: January 27, 1999

http://www.weblearn.hs-bremen.de/risse/JScript/ACROJS.PDF

It is very old, but still useful.

+1
Nov 26 '13 at 19:51
source share



All Articles