Take a survey

Developing Applications Using APIs > Assembling PDF Documents > Adding and Manipulating Page Content > Specifying styled text > Built-in keys

Built-in keys
You can use the Assembler service built-in keys to insert variable information into headers, footers, watermarks, backgrounds, and TOC entries. These keys are effectively replaced by strings as the DDX document is processed.
You can use built-in keys in two ways:
As element names within the styled text elements p, span, i, and b to represent variable text. For example, the _Title element in this example is replaced by the title of the result document.
	<StyledText><p><_Title></p></StyledText>
As strings representing attribute values (or parts of values). The bookmarkTitle attribute of the TableOfContents or PDF source elements and the prefix attribute of the PageLabel element can use the metadata keys _Title, _SourceTitle, _Author, _SourceAuthor, _Subject, _SourceSubject, _Created, and _Modified. The start attribute of the PageLabel element can use the _PageNumber key only
For example, the following snippet causes a bookmark to be generated in the result document containing the name of the author of the source document.
		<PDF source="doc1" bookmarkTitle="By _SourceAuthor"/>
If the author is "Adobe Systems Incorporated", the resulting bookmark will be "By Adobe Systems Incorporated".
The following example uses two built-in keys as elements within a StyledText element to specify information in a header. The header shows the page number (which is different for each page) and the total number of pages (which is constant for the entire result document).
Example: Using built-in keys
<PDF result="doc3.pdf">
	<Header>
		<Center>
			<StyledText>
				<p>Page <_PageNumber> of <_LastPageNumber></p>
			</StyledText>
		<Center>
	<Header/>
	<PDF source="doc1.pdf"/>
	<PDF source="doc2.pdf"/>
</PDF>
Assuming the result document contains 30 pages, it will contain a centered header on each page in the sequence "Page 1 of 30", "Page 2 of 30", and so on.
_Created, _Modified, and _DateTime can have an optional styleReference attribute that refers to a DatePattern element defined within a StyleProfile element. See Formatting dates for details.
This example uses two documents with the following metadata:
doc1.pdf: Title is History of Chocolate and Author is Charlie
doc2.pdf: Title is Chocolate Futures and Author is Willy
Example: Using built-in keys
<PDF result="doc3.pdf">
	<TableOfContents styleReference="myTOC"/>
	<PDF source="doc1.pdf" bookmarkTitle="Section 1: _SourceTitle"/>
	<PDF source="doc2.pdf" bookmarkTitle="Section 2: _SourceTitle"/>
	<Watermark>
		<StyledText>
			<p>This was created by 				<_Author/>.</p>
		</StyledText>
	</Watermark>
</PDF>
This example would result in these table of content entries for doc3.pdf:
	Section 1: History of Chocolate ..... 1
	Section 2: Chocolate Futures .......200
along with a watermark which contains the text "This was created by Charlie."

 

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/assemblePDFPage_content.103.11.html