Take a survey

Developing Applications Using APIs > Assembling PDF Documents > Working with Bookmarks > Exporting and importing bookmarks

Exporting and importing bookmarks
The Assembler service supports an XML representation of bookmarks. This representation conforms to a schema whose namespace is http://ns.adobe.com/xpdf/1.6. The bookmarks schema is documented in the Document Description XML Reference. You can export bookmarks to this format or import them from this format.
To export bookmarks, use a Bookmarks result element. The following example exports bookmarks from doc2 and doc3 to doc1.xml.
Example: Exporting bookmarks
<Bookmarks result="doc1.xml">
	<PDF source="doc2"/>
	<PDF source="doc3"/>
</Bookmarks>
A Bookmarks result element can have any number of PDF source or PDFGroup elements as children. It can also have Bookmarks source or filter elements as children. The bookmarks appear in the order they would appear if all the source documents were assembled together into a PDF document. In the above example, if doc2 has 5 pages, a bookmark in doc3 that refers to page 2 will be updated in the result document to refer to page 7.
You can save doc1.xml to a file and use it in a separate part of your workflow. You can also refer to it in the same DDX file to include its bookmarks in another result document.
Example: Adding bookmarks from one document to another
<Bookmarks result="doc1.xml" return="false">
	<PDF source="doc2"/>
</Bookmarks>
<PDF result="doc3">
	<PDF source="doc4"/>
	<Bookmarks source="doc1.xml"/>
</PDF>
In this example, the bookmarks from doc2 are included in doc1.xml, which in turn is used to add bookmarks to doc3. Note the following features of this example:
The return attribute of the Bookmarks result element is set to false because doc1.xml is being used only in the current DDX file and therefore does not need to be returned as a stream to the client. (By default, return is true.)
The bookmarks from doc1.xml are appended to the bookmarks from doc4 (if any) in the result document doc3. To instead replace the bookmarks from doc4 with those from doc1.xml, make the Bookmarks element a child rather than a sibling of the PDF source element, as in the following example.
Example: Replacing bookmarks
<PDF result="doc3">
	<PDF source="doc4">
		<Bookmarks source="doc1.xml"/>
	</PDF>
</PDF>

 

Send me an e-mail when comments are added to this page | Comment Report

Current page: http://livedocs.adobe.com/livecycle/es/sdkHelp/programmer/sdkHelp/assemblePDFBookmarks.97.3.html