Adobe 38043740 - ColdFusion Standard - Mac Development Manual page 963

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
<!--- The following code populates the tax form template chosen from the list with
information from the database query and the login form. Because no destination is
specified, ColdFusion displays the interactive PDF form in the browser. A hidden field
in the PDF form contains the name of the output file to write. It is a combination of
the user name and the last three numerals of the user SSN#. The submit button added to
the form created in Acrobat contains a URL to the ColdFusion processing page. --->
<cfpdfform source="taxForms/#form.myTaxForm#" action="populate">
<cfif "taxForms/#form.myTaxForm#" is "taxForms/f1040.pdf">
<cfpdfformparam name="f1_04(0)" value="#form.Firstname#">
<cfpdfformparam name="f1_05(0)" value="#form.Lastname#">
<cfpdfformparam name="f2_115(0)" value="#form.Phone#">
<cfpdfformparam name="f1_06(0)" value="#form.SS1#">
<cfpdfformparam name="f1_07(0)" value="#form.SS2#">
<cfpdfformparam name="f1_08(0)" value="#form.SS3#">
<cfpdfformparam name="filerID" value="#form.taxFiler#_1040">
<cfelseif "taxForms/#form.myTaxForm#" is "taxForms/f1040ez.pdf">
<cfpdfformparam name="f1_001(0)" value="#form.Firstname#">
<cfpdfformparam name="f1_002(0)" value="#form.Lastname#">
<cfpdfformparam name="f1_070(0)" value="#form.Phone#">
<cfpdfformparam name="f1_003(0)" value="#form.SS1#">
<cfpdfformparam name="f1_004(0)" value="#form.SS2#">
<cfpdfformparam name="f1_005(0)" value="#form.SS3#">
<cfpdfformparam name="filerID" value="#form.taxFiler#_1040ez">
</cfif>
</cfpdfform>
The fourth ColdFusion page uses the
The filename is generated from the value of the hidden field in the tax form. The
uses the DDX instructions in the watermark.ddx file to generate a text-string watermark and apply it to the form.
The following code shows the contents of the watermark.ddx file:
<?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">
<PDF source="Doc1">
<Watermark rotation="30" opacity="65%">
<StyledText><p font-size="85pt" font-weight="bold" color="gray"
font="Arial">FINAL</p></StyledText>
</Watermark>
</PDF>
</PDF>
</DDX>
<!--- The following code reads the PDF file submitted in binary format and generates a result
structure called fields. The cfpdfform populate action and the cfoutput tags reference
the fields in the structure. --->
<cfpdfform source="#PDF.content#" action="read" result="fields"/>
<cfpdfform action="populate" source="#PDF.content#"
destination="FiledForms\#fields.filerID#.pdf" overwrite="yes"/>
<!--- The following code verifies that the DDX file exists and the DDX instructions are
valid. --->
tag to process the PDF post submission and generate an output file.
cfpdfform
Last updated 1/20/2012
action of the
processddx
cfpdf
958
tag

Advertisement

Table of Contents
loading

This manual is also suitable for:

Coldfusion 9

Table of Contents