Adobe 38043740 - ColdFusion Standard - Mac Development Manual page 932

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
<h3>Employee Login Form</h3>
<p>Please enter your user name and password.</p>
<cfform name="loginform" action="embed2.cfm" method="post">
<table>
<tr>
<td>user name:</td>
<td><cfinput type="text" name="username" required="yes"
message="A user name is required."></td>
</tr>
<tr>
<td>password:</td>
<td><cfinput type="password" name="password" required="yes"
message="A password is required."></td>
</tr>
</table>
<br/>
<cfinput type="submit" name="submit" value="Submit">
</cfform>
On the processing page, a query populates an interactive PDF form from the cfdocexamples database. The interactive
PDF form is embedded in a PDF document created with the
sections: the
cfdocumentsection
the second section embedded in the PDF document. Each section starts a new page in the PDF document. The Print
button on the PDF form prints the entire document, including the pages in the sections before and after the interactive
PDF form.
<cfquery name="getEmpInfo" datasource="cfdocexamples">
SELECT * FROM EMPLOYEES
WHERE EMAIL = <cfqueryparam value="#FORM.username#">
</cfquery>
<!--- The following code creates a PDF document with headers and footers.
--->
<cfdocument format="pdf">
<cfdocumentitem type="header">
<font size="-1" align="center"><i>Nondisclosure Agreement</i></font>
</cfdocumentitem>
<cfdocumentitem type="footer">
<font size="-1"><i>Page <cfoutput>#cfdocument.currentpagenumber#
of#cfdocument.totalpagecount#</cfoutput></i></font>
</cfdocumentitem>
<!--- The following code creates the first section in the PDF document. --->
<cfdocumentsection>
<h3>Employee Nondisclosure Agreement</h3>
<p>Please verify the information in the enclosed form. Make any of the necessary changes
in the online form and click the <b>Print</b> button. Sign and date the last page. Staple
the pages together and return the completed form to your manager.</p>
</cfdocumentsection>
<!--- The following code embeds an interactive PDF form within the PDF document with fields
populated by the database query. The cfpdpfform tag automatically creates a section in
the PDF document. Do not embed the cfpdfform within cfdocumentsection tags. --->
<cfpdfform action="populate" source="c:\forms\embed.pdf">
<cfpdfsubform name="form1">
<cfpdfformparam name="txtEmpName"
cfdocument
tags define the first and last sections of the document; the
Last updated 1/20/2012
tag. The PDF document comprises three
cfpdfform
927
tag defines

Advertisement

Table of Contents
loading

This manual is also suitable for:

Coldfusion 9

Table of Contents