Adobe 38043740 - ColdFusion Standard - Mac Development Manual page 937

Developing applications
Hide thumbs Also See for 38043740 - ColdFusion Standard - Mac:
Table of Contents

Advertisement

DEVELOPING COLDFUSION 9 APPLICATIONS
Working with Documents, Charts, and Reports
Task
Password-protect PDF documents
Set the initial view for a PDF document
Create different versions of a PDF document
Using shortcuts for common tasks
You use the
tag actions to perform shortcuts to common PDF document assembly and manipulation.
cfpdf
Adding and removing watermark images
Use the
and
addWatermark
removeWatermark
create a watermark and apply it to a PDF document in one of the following ways:
• Use an image file as a watermark.
• Specify a variable that contains an image file.
• Specify a ColdFusion image.
• Use the first page of a PDF document as a watermark.
Note: You can also use the
Watermark
watermark. For more information, see
Using an image file as a watermark
The following example shows how to specify an image file as a watermark:
<cfpdf action="addWatermark" source="artBook.pdf"
image="../cfdocs/images/artgallery/raquel05.jpg" destination="output.pdf"
overwrite="yes">
By default, ColdFusion centers the image on the page, sets the opacity of the image to 3 out of 10 (opaque), and displays
the image in the background of each page in the output file. In the following example, ColdFusion displays the
watermark in the foreground, offset 100 pixels from the left margin of the page and 100 pixels from the bottom margin
of the page. Because the opacity is set to 1, the image does not obscure the page content.
<cfpdf action="addWatermark" source="artBook.pdf"
image="../cfdocs/images/artgallery/raquel05.jpg" destination="output.pdf"
overwrite="yes" foreground="yes" opacity=1 showOnPrint="no" position="100,100">
For a complete list of attributes and settings, see the cfpdf tag in the CFML Reference.
With the ColdFusion 9 release, the
example shows that if you set the parameters for a new image to rgb or argb and then use the cfpdf
action=addwatermark, ColdFusion allows this action:
<!---setting the argb format for myImage--->
<cfset myImage = ImageNew("",200,200,"argb","gray")>
<!---adding watermark for myImage--->
<cfpdf action="addwatermark" rotation="45" foreground="true" image="#myImage#"
source="RemoveArts.pdf" destination="dest.pdf"
Action
cfpdf action="protect" newUserPassword
cfpdf action="processddx"
element
Duplicate
function to clone PDF variables
actions to add and remove watermarks from PDF documents. You can
or
DDX elements with the
Background
"Using DDX to perform advanced
action now supports the
addWatermark
overwrite="yes">
Last updated 1/20/2012
="
xxxx
"
with the
InitialViewProfile
action to create a text-string
processddx
tasks" on page 943.
and
formats also. The following
rgb
argb
932
DDX

Advertisement

Table of Contents
loading

This manual is also suitable for:

Coldfusion 9

Table of Contents