These forums are now Read Only. If you have an Acrobat question, ask questions and get help from one of our experts.

Batch processing file attachments using Javascript

Philip Roy
Registered: Mar 30 2010
Posts: 2

Hello;

I have the need to attach a large amount of files to a large amount of PDF documents. My problem is, I need the javacript to look in the file name of the pdf, and attach a file of the same name but different format to each file.

If I could somehow batch this process it would be great. Any help is welcome, thanks!

Phil

My Product Information:
Acrobat Pro 9.0, Windows
thomp
Expert
Registered: Feb 15 2006
Posts: 4411
Not a problem, Batch scripts operate in privileged context, so any property or functin in the JavaScript reference can be run in a batch script. What you want to do is import files as attachments. In Acrobat JavaScript this is done with the doc.importDataObject() function.

Read this article:
http://www.acrobatusers.com/tutorials/importing-and-exporting-pdf-file-attachments-acrobat-javascript

Thom Parker
The source for PDF Scripting Info
[url=http://www.pdfScripting.com]pdfscripting.com[/url]

The Acrobat JavaScript Reference, Use it Early and Often
[url=http://www.adobe.com/devnet/acrobat/javascript.php]http://www.adobe.com/devnet/acrobat/javascript.php[/url]

Then most important JavaScript Development tool in Acrobat
[url=http://www.pdfscripting.com/public/34.cfm#JSIntro][b]The Console Window (Video tutorial)[/b][/url]
[url=http://www.acrobatusers.com/tutorials/2006/javascript_console][b]The Console Window(article)[/b][/url]

Thom Parker
The source for PDF Scripting Info
www.pdfscripting.com
Very Important - How to Debug Your Script