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

Create PDF With bookmarks mirroring folder structure using JS or Batch

sgamble6
Registered: Apr 6 2010
Posts: 4

I have a rather complex folder structure in which all of the files are PDFs. I am trying to merge them into one PDF document but want to retain the hierarchy in the bookmarks. I have tried searching the forums and internet but haven't had any luck.

Thanks

My Product Information:
Acrobat Standard 8.1.2, Macintosh
thomp
Expert
Registered: Feb 15 2006
Posts: 4411
There's no easy or built-in way to do this with Acrobat JavaScript because after the file is inserted there is no way to know where it came from. And the fact that you have standard, and are on a Mac limits the options. But there are still a couple of different ways you could approach the problem.

There are no file system operations in Acrobat javaScript so you can't write a script to do the file insertion (unless you already have a list of file paths) and since you are on standard you can't use a batch process. So you need a way concatonate the files together that also saves the original file structure.

I think the best approach is to use the Acrobat Interapplication Communication (IAC) interface to write an Apple script to insert the files into a master document. Part of this process could be either creating the bookmarks or saving the original doc path info into a hidden field on the page you want bookmarked. Then a post processing script could be used to create the bookmarks.

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

rbogie
Registered: Apr 28 2008
Posts: 432
experiment with this: menu create > 'merge files into single pdf' > click 'add files ...' > add folders (in desired order, as many times as needed) > options button: check 'always add bookmarks ...' > click button 'combine files'. hit F4 to display navigation pane > click bookmarks panel button. manually reorder the bookmarks in any hierarchy as needed. optional: set document properties (ctrl+D) > tab 'initial view' > on 'navigation tab' dropdown menu select 'bookmarks panel and page' > click OK. save file.