Import/Export Bookmarks from/to file using javascript

PDF-XChange Viewer SDK for Developer's
(ActiveX and Simple DLL Versions)

Moderators: TrackerSupp-Daniel, Tracker Support, Vasyl-Tracker Dev Team, Chris - Tracker Supp, Sean - Tracker, Ivan - Tracker Software, Tracker Supp-Stefan

divspirit
User
Posts: 14
Joined: Tue Sep 23, 2014 7:00 am

Import/Export Bookmarks from/to file using javascript

Post by divspirit »

Hi,

I have a webpage with a PDFXchange ActiveX component on it. When I use

Code: Select all

RunJavaScript('this.exportAsXFDF(true, true, null, "file.xfdf", true);');
then only the annotations are extracted and not the bookmarks.

1. Is it possible to import bookmarks from a file/string using javascript?
2. Is it possible to export bookmarks to a file/string using javascript?

Kind regards,
Auke
User avatar
Tracker Supp-Stefan
Site Admin
Posts: 17960
Joined: Mon Jan 12, 2009 8:07 am
Location: London

Re: Import/Export Bookmarks from/to file using javascript

Post by Tracker Supp-Stefan »

Hello Auke,

The bookmakrs of a PDF file are stored in it's internal structure in a special bookmarks dictionary. The export to fdf/xfdf commands are intended for annotations only, and bookmarks are not annotations.
There are some JS methods (separate than those for annotations) that can allow you to e.g. enumerate the bookmarks in a given file, and there are also methods for the creation of bookmarks and for assigning actions to them, however I can't see in the JS API any methods that will allow you to read the actions associated with existing bookmarks (so that you can copy them).
Please take a look at the Bookmakrs Methods listed here (page 178 onwards):
http://www.adobe.com/content/dam/Adobe/ ... erence.pdf

Regards,
Stefan