The PDF list is a service provided by PDFzone.com | http://www.pdfzone.com __________________________________________________________________
[EMAIL PROTECTED] wrote:
Sara,The PDF list is a service provided by PDFzone.com | http://www.pdfzone.com __________________________________________________________________> Isn't there a > javascript to add the javascript?????
Yes it's possible, in Acrobat 5 and 6 Pro at least.
So how do you do it?
When I want to add a javascript to a bunch of pdfs, I create an fdf that includes the javascript I want. I then go to File, Batch Processing, (or Advanced, Batch Processing in version 6 pro), New Sequence, and create a new sequence. Give it a name, like "Add JS". On the Batch Edit Sequence page, choose Select Commands. and then locate Execute JavaScript in the left panel and click Add to move it to the right panel. Now, double-click it in the right panel (or click Edit) and add something like the following:
this.importAnFDF("c:/temp/myJS.fdf");
Here you are telling the batch sequence to import the fdf that contains the javascript you want. Save everything and OK your way back to the Batch Sequences box. Here you can run your new sequence on a directory full of pdfs. The javascript contained in the fdf will be saved in each one.
Now, how do you get the javascript into the fdf? Excellent question. If it is simple, you can create the fdf by hand and include your javascript in the /JavaScript tag in the fdf. But, if it's complex, you'll want to embed the javascript some other way. I use the fdf toolkit to do this. It works, but it seems a bit awkward. My javascript file is now more than 1200 lines and I maintain it as a text file. So, using the toolkit, I tell it to create my fdf and include my javascript file. When it's done, I point to it with the importAnFDF call above.
Acrobat makes a distinction between actions that can be performed in batch mode and non-batch mode. This is for security reasons. I may be wrong, but I think a batch sequence is the only way to add javascript to a bunch of pdfs. Again, for security reasons, you can simply write a javascript that adds javascript without setting the this.disclosed flag to true, which an only be done in batch mode or by hand. But, now I'm rambling.
Let me know if you have questions.
Bill
To change your subscription: http://www.pdfzone.com/discussions/lists-pdf.html
