Take a survey

Developing Applications Using APIs > Assembling PDF Documents > Working with Annotations > Importing and exporting comments

Importing and exporting comments
You can export a representation of the comments in a PDF document to a file and you can import comments from a file. The following file formats can be used to store comments:
Note: In addition to comments, FDF can also be used to store information about links and form fields. In the Assembler service, however, you can use FDF only for comments. Links must be imported and exported using XFDF, and the Assembler service cannot import and export form fields. For more information, see Working with links).
Some comment types are of special interest:
The Assembler service provides special functionality with regard to file attachments. Page-level (not document-level) file attachments are considered comments and can be imported and exported in the same way as all other comments. For more information on file attachments, see Working with File Attachments.
The Comments element can be used in several ways:
As a source element, it specifies an FDF or XFDF stream containing comments.
As a result element, it contains comments from the aggregation of its child elements and is returned as an FDF or XFDF string. A Comments result element can appear only as a child of the DDX element.
You can also select specific comments (see Selecting specific comments).
In this example, all comments from doc1.pdf are exported in XFDF format.
Example: Exporting comments as XFDF
<Comments result="doc1comments.xfdf" format="XFDF">
	<PDF source="doc1.pdf"/>
</Comments>
In this example, doc2comments.xfdf contains comments that were exported previously. Because the Comments source element is a child of the PDF source, the comments from doc2comments.xfdf replace those in doc1.pdf.
Example: Replacing comments
<PDF result="doc3.pdf">
	<PDF source="doc1.pdf">
		<Comments source="doc2comments.xfdf"/>
	</PDF>
</PDF>
In this example, the Comments source element is a sibling of the PDF source. Therefore, its comments are combined with those in the PDF source, doc1.pdf, and included in the result.
Example: Importing additional comments
<PDF result="doc2.pdf">
	<PDF source="doc1.pdf"/>
	<Comments source="comments.xfdf"/>
</PDF>
In this example, comments are exported from one document and then imported into another. The Comments result element from the first step is subsequently used as a source element to create a PDF result.
Example: Exporting and importing comments
<Comments result="doc1comments.xfdf" format="XFDF">
	<PDF source="doc1_rev1.pdf"/>
</Comments>
<PDF result="doc2.pdf">
	<PDF source="doc1_rev2.pdf"/>
	<Comments source="doc1comments.xfdf"/>
</PDF>
The same thing can be accomplished by means of a Comments filter element, which is like a result element except that it can be used in the same way as a source element. The comments are exported from doc1_rev1.pdf and imported into doc2.pdf without the use of XFDF.
Example: Using a comments filter element
<PDF result="doc2.pdf">
	<PDF source="doc1_rev2.pdf"/>
	<Comments>
		<PDF source="doc1_rev1.pdf"/> 
	</Comments>
</PDF>
The next section describes how you can select specific comments to export or import.

 

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/assemblePDFComments.98.3.html