Take a survey

Developing Applications Using APIs > Assembling PDF Documents > Working with File Attachments > Attaching files to a PDF document > Document-level file attachments

Document-level file attachments
To attach a file at the document level, you use a FileAttachments source element and specify the following information:
The source attribute specifies the contents of the file to be attached.
The nameKey attribute specifies a unique identifier for the document. If you specify a value of "*", the Assembler service generates an identifier automatically.
The File subelement specifies the file name for the attachment and optionally the MIME type, creation date, and modification date.
The FilenameEncoding subelement specifies the encoding for the file name.
The Description subelement provides descriptive text.
This example attaches the file data.pdf to the result document.
Example: Attaching a file to the document
<PDF result="doc2.pdf">
	<FileAttachments source="data.pdf" nameKey="data1">
		<File filename="/documents/data.pdf" mimetype="application/pdf"/>
		<FilenameEncoding encoding="UTF-8"/>
		<Description>What this file does</Description>
	</FileAttachments>
	<PDF source="doc1.pdf"/>
</PDF>
In this example above, the FileAttachments source element is a sibling of the PDF source element. Therefore, all file attachments in the original document doc1.pdf are preserved. In the following example, data2.pdf would be attached to the source (and hence the result), but all other attachments in doc1.pdf would be deleted.
Example: Replacing file attachments
<PDF result="doc2.pdf">
	<PDF source="doc1.pdf">
		<FileAttachments source="data.pdf" ... additional attributes />
	</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/assemblePDFFile_attachments.99.4.html