There are two ways to do this: You can either copy the bookmarks themselves with a recursive function, or you can replace the pages of the source document with those of the target document. The latter has the benefit that it maintains the actions associated with the bookmarks.
- AcrobatUsers Community Expert - Contact me personally at try6767 [at] gmail [dot] com
Check out my custom-made scripts website: http://try67.blogspot.com
Thanks Guys... I have a thought like, we can export the bookmarks as a text file with destination details and the same text file we can import in the targeted pdf. Is this possible? Yes means, how can i do?... I am a beginner in Acrobat javascript.
As we've said, using JavaScript you cannot read the actions of a bookmark, only the name displayed in the side panel. Exporting them with the actions and destinations intact is only possible with a plugin.
That's not completely true. If the bookmarks only point to a page number, then that can be identified with a script and used when re-creating the bookmarks in the new file.
- AcrobatUsers Community Expert - Contact me personally at try6767 [at] gmail [dot] com
Check out my custom-made scripts website: http://try67.blogspot.com
You can use the Bookmark object's execute() method to execute it. Then you can read the current page number and use if when re-creating the bookmark in the new file by setting its action with setAction().
- AcrobatUsers Community Expert - Contact me personally at try6767 [at] gmail [dot] com
Check out my custom-made scripts website: http://try67.blogspot.com
Thanks for your reply. But I am not sure how to use this in Java script bcoz im a beginner in JavaScript. Can you give me a starting code for this, it will help alot for me.
Try67's method only works when the bookmarks being executed are goto page action or a JavaScript that sets a page value. But bookmarks can be used to execute many menu items and run a JavaScript includes more than going to given page number.
The latter has the benefit that it maintains the actions associated with the bookmarks.
- AcrobatUsers Community Expert - Contact me personally at try6767 [at] gmail [dot] com
Check out my custom-made scripts website: http://try67.blogspot.com