Take a survey

Section A - DDX User Guide > Adding and Manipulating Page Content > Using style profiles

Using style profiles
A StyleProfile element can specify information about a header, footer, watermark, background, table of contents, and/or date pattern. that can be used in more than one place in a DDX document. It enables you to create and maintain a set of named styles that can be used in a DDX document as needed. You can refer to a style profile in multiple places in the same DDX document or include it in multiple DDX documents if you create DDX programmatically.
For example, you may want to include the same header in two or more result documents. You can accomplish this in the following way:
Enclose a Header element describing the header within a StyleProfile element.
Set the name attribute of the StyleProfile element to an identifying name.
Use this name as the value of the styleReference attribute of all the Header elements to which you want to apply the style profile.
The following example places the same header in two different result documents.
Example: Using a style profile in two result documents
<PDF result="doc2.pdf"> 
	<PDF source="doc1.pdf">
		<Header styleReference="myProfile"/>
	</PDF>
</PDF>	
<PDF result="doc4.pdf"> 
	<PDF source="doc3.pdf">
		<Header styleReference="myProfile"/>
	</PDF>
</PDF>	
<StyleProfile name="myProfile">
	<Header>
		<Left> <!--styled text--></Left>
		<Center><!--styled text--></Center>
		<Right><!--styled text--></Right>
	</Header>
</StyleProfile>
Each StyleProfile can contain the following elements: Header, Footer, Watermark, Background, TableOfContents, or DatePattern. There can be at most one of each element, except when distinguishing between odd and even pages, in which case there can be two (see Odd and even pages).
Note: In terms of scope, elements that refer to definitions within StyleProfile elements are treated as if the definition appeared directly inline.
With one exception, any of those elements appearing elsewhere in the DDX can refer to the description in the style profile by means of the styleReference attribute.
The exception is DatePattern, which cannot appear anywhere other than in a StyleProfile element. It formats dates specified by the built-in keys _Created, _Modified, and _DateTime. Those keys can reference a DatePattern element in a style profile by means of a styleReference attribute.
A DDX document can contain any number of StyleProfile elements as children of the DDX root element. The following example shows the use of two different profiles.
Example: Using two style profiles
<PDF result="doc2.pdf">
	<PDF source="cover.pdf" pages="1">
		<Header styleReference="cover"/>
		<Footer styleReference="cover"/>
	</PDF>
	<PDF source="doc1.pdf">
		<Header styleReference="body"/>
		<Footer styleReference="body"/>
	</PDF>
</PDF>
 
<StyleProfile name="cover">
	<DatePattern><DayNumber/> / <ShortMonthName/> / <Year/></DatePattern>
	<Header>
		<Left>
			<StyledText>
			<p><_DateTime styleReference="cover"/></p>
			</StyledText>
		</Left>
		<Right><StyledText><p>Draft</p></StyledText></Right>
	</Header>
	<NoFooters/>
</StyleProfile>
 
<StyleProfile name="body">
	<Header>
		<Center> <StyledText><p>Confidential</p></StyledText></Center>
		<Left>
			<StyledText><p>
				<_DateTime styleReference="cover"/>
			</p></StyledText>
		</Left>
		<Right><StyledText><p>Draft</p></StyledText></Right>
	</Header>
	<Footer alternation="EvenPages">
		<Left>
			<StyledText>
			<p>Page <_PageNumber/> of <_LastPageNumber/></p>
			</StyledText>
		</Left>
	</Footer>
	<Footer alternation="OddPages">
		<Right>
			<StyledText>
			<p>Page <_PageNumber/> of <_LastPageNumber/></p>
			</StyledText>
		</Right>
	</Footer>
</StyleProfile>

Section A - DDX User Guide > Adding and Manipulating Page Content > Using style profiles

Document Description XML (DDX) Help
LiveCycle ES Update 1

 

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

Current page: http://livedocs.adobe.com/livecycle/8.2/ddxRef/000690.html