Within JS, is there a way to loop through all text formatting styles and create bookmarks for certain styles?
I have created a combined doc using the insert pages function with JS but seem to be missing the bookmarks.
When trying to insert bookmarks based on the structure through Acrobat-Bookmark-Options, I get all the desired bookmarks but they are all level 1 bookmarks.
I would like to loop through all formatting types and create bookmarks as follows:
level 1 - Heading 1
level 2 - Heading 2
level 3 - Heading 3
etc...
I am pretty sure a recursive loop will work, but I am unsure how to test the structure/formatting of a text section. Can someone point me in the right direction for determining the formatting attached to a pdf text section?
http://www.acrobatusers.com/forums/aucbb/viewtopic.php?id=23123
I had no idea this is what you wanted to do. So the answer is No there is no reasonable way to do this. Primarily because Acrobat does not contain any logical content structure. The structure in a PDF has to do with placment of graphical items on the page. The is no such thing as a paragraph or heading. Words don't even have to appear in order.
These kinds of bookmarks are added to a PDF when it is converted from it's native application. Merging two documents and maintaining the bookmarks is beyound the capabilities of Acrobat JavaScript. JavaScript cannot copy a bookmark from one document to another because the bookmark destinations only make sense in thier own document.
To do this you need more sophisticated merge and bookmark tools. Both www.artspdf.com and www.evermap.com make tools that might help with this.
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