
949
DEVELOPING
COLDFUSION 9 APPLICATIONS
Working with Documents, Charts, and Reports
Las
t
upda
te
d 8/5/2010
For more information on
IntialViewProfile
settings, see the
Adobe LiveCycle Assembler Document Description
XML Reference.
Adding text-string watermarks
You use the
processddx
action with the
Background
or
Watermark
DDX elements to create a text-string watermark.
Background
elements appear in the background (behind the contents of the page);
Watermark
elements display in the
foreground (over the contents of the page). The syntax for both the elements is the same.
The following example shows the DDX page for using the text string
"DRAFT"
as a watermark. The watermark appears
on every page of the output file. By default, the watermark appears in the middle of the page. In this example, the
watermark is rotated 30 degrees:
<?xml version="1.0" encoding="UTF-8"?>
<DDX xmlns="http://ns.adobe.com/DDX/1.0/"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://ns.adobe.com/DDX/1.0/ coldfusion_ddx.xsd">
<PDF result="Out1">
<Watermark rotation="30" opacity="65%">
<StyledText><p font-size="50pt" font-weight="bold" color="lightgray"
font="Arial">DRAFT</p></StyledText>
</Watermark>
...
</PDF>
</DDX>
The following example shows how to add different backgrounds on alternating pages. The
verticalAnchor
attribute
displays the background text at the top of the page:
<?xml version="1.0" encoding="UTF-8"?>
<DDX xmlns="http://ns.adobe.com/DDX/1.0/"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://ns.adobe.com/DDX/1.0/ coldfusion_ddx.xsd">
<PDF result="Out1">
<Background alternation="EvenPages" verticalAnchor="Top">
<StyledText><p font-size="20pt" font-weight="bold" color="gray"
font="Arial">DRAFT</p></StyledText>
</Background>
<Background alternation="OddPages" verticalAnchor="Top">
<StyledText><p font-size="20pt" font-weight="bold" color="gray"
font="Arial"><i>Beta 1</i></p></StyledText>
</Background>
...
</PDF>
</DDX>
Instead of applying watermarks to the entire output file, you can apply them to individual source files. The following
example applies a different background to the first three chapters of a book. The fourth chapter has no background: