PDA

View Full Version : add javascript to pdf



tfit
11-05-2008, 10:09 AM
What post process software is there to add javascript functionality to pdf's?

timfink62
11-05-2008, 02:33 PM
If you have Adobe Acrobat Professional, you can embed JavaScript into almost any custom action for an interactive element, including Page Open/Close, and in buttons.

In any element that accepts an Action in its properties window, drop down to the Run JavaScript in the Actions list and either type in your JS code in the resulting window or load in a .js file you already have made.

tfit
11-05-2008, 03:39 PM
Thanks for your reply but it isn't really an option for me; I just need to add javascript to some pages and using a gui would be very time consuming. I should have stated that i want a command line tool. The pdf's are also created from command line.
Have you any experience with the sdk's? I see 7.05 and 8.1 are now free of charge.
If no one else will come up with an answer that will be my best bet.

tfit
11-06-2008, 06:34 PM
I think i'm going to use Itext

rsmoorthy
01-20-2012, 08:53 AM
I know this is a very old thread, but here is one possible option to embed Javascript into an existing PDF

http://blog.rsmoorthy.net/2012/01/add-javascript-to-existing-pdf-files.html

Moorthy

stevnetk
03-10-2012, 10:04 AM
Have a look at this hiqpdf.com library
This is a nice demo (hiqpdf.com/demo/PdfOpenAction.aspx) about how to set an action to be executed when the PDF document is opened. There are 4 possible types of actions: execute a JavaScript, go to a location in PDF, submit PDF document form and reset PDF document form. Have a look