Take a survey

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

Specifying styled text
When you add items such as headers, footers, watermarks, backgrounds, and table of contents entries to a PDF document, you can specify style information for the text contained in those items. You specify style information by using the StyledText element, which can be the child of a Header, Footer, Watermark, Background, or TableOfContentsEntryPattern element.
The following example adds a watermark with the text "Draft", in bold, to all the pages in the result document.
Example: Adding a watermark using styled text
<PDF result="doc2">
	<Watermark>
		<StyledText>
			<p> 
				<b>Draft</b>
			</p>
		</StyledText>
	</Watermark>
	<PDF source="doc1"/>
</PDF>
A StyledText element contains as children one or more p (paragraph) elements. The p element can contain any (zero or more) of the following items:
A built-in key (see Built-in keys) that generates a text string depending on the value of a system or document property.
The b (bold) element, as shown in the previous example.
The i (italic) element.
The Space element, which specifies a space between two styled text elements.
The span element, which contains inline text, to which formatting can be applied.
The leader element, which is used for table of contents entries and specifies a pattern used to fill a line.
Each of the rich text elements (StyledText, p, b, i, span, and leader) can have attributes that specify further information, as described in the next section.
Note: You should remove any unnecessary white space, including line feed and tab characters, from DDX elements that contain text. Unnecessary white space can result in unexpected line feeds or spaces. The p, b, i, span, and DatePattern elements are used to display styled text. If only white space is required between two child elements, use the nonbreaking space entity number &#160; or the Space element for the DatePattern element and rich text elements. The &nbsp; entity reference is not defined.

 

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.9.html