Adobe 38043740 - ColdFusion Standard - Mac Development Manual page 938

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
Using a variable that contains an image file
You can specify a variable that contains an image as a watermark. The following example shows how to create a form
from which the user can select an image:
<!--- The following code creates a form where you can choose an image to use
as a watermark. --->
<h3>Choosing a Watermark</h3>
<p>Please choose the image you would like to use as a watermark.</p>
<!--- Create the ColdFusion form to select an image. --->
<table>
<cfform action="addWatermark2.cfm" method="post"
enctype="multipart/form-data">
<tr>
<td><img src="../cfdocs/images/artgallery/maxwell01.jpg"/><br/>
<cfinput type="radio" name="art" value="../cfdocs/images/artgallery/maxwell01.jpg"
checked="yes">
Birch Forest</td>
<td><img src="../cfdocs/images/artgallery/raquel05.jpg"/><br/>
<cfinput type="radio" name="art" value="../cfdocs/images/artgallery/raquel05.jpg">
Lounging Woman</td>
<td><img src="../cfdocs/images/artgallery/jeff01.jpg"/><br/>
<cfinput type="radio" name="art"
value="../cfdocs/images/artgallery/jeff01.jpg">Celebration</td>
<td><img src="../cfdocs/images/artgallery/paul01.jpg"/><br/>
<cfinput type="radio" name="art"
value="../cfdocs/images/artgallery/paul01.jpg">Guitarist
</td>
</tr>
</table>
<br/>
<cfinput type="Submit" name="submit" value="Submit"></p>
</cfform>
The processing page uses the image selected from the form as the watermark for a PDF file:
<!--- ColdFusion applies the image selected from the form as the watermark in a PDF document
by using the input variable form.art. --->
<cfpdf action="addwatermark" source="check.pdf" image="#form.art#" destination="output.pdf"
foreground="yes" overwrite="true">
<p>The watermark has been added to your personalized checks.</p>
Using a ColdFusion image as a watermark
You can specify a ColdFusion image as a watermark. You can extract an image from a database and manipulate the
image in memory, but you don't have to write the manipulated image to a file. Instead, you can apply the manipulated
image as a watermark in a PDF document.
In the following example, the first ColdFusion page extracts images from a database and populates a pop-up menu with
the titles of the artwork:
Last updated 1/20/2012
933

Advertisement

Table of Contents
loading

This manual is also suitable for:

Coldfusion 9

Table of Contents