Adobe 38043740 - ColdFusion Standard - Mac Development Manual page 930

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 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"/>
<cfset empForm="#fields.form1#">
<cfpdfform action="populate" source="#PDF.content#"
destination="timesheets\#empForm.txtsheet#.pdf" overwrite="yes"/>
<h3>Timesheet Completed</h3>
<p><cfoutput>#empForm.txtempname#</cfoutput>,</p>
<p>Thank you for submitting your timesheet for the week of
<cfoutput>#DateFormat(empForm.dtmForPeriodFrom, "long")#</cfoutput> through
<cfoutput>#DateFormat(empForm.dtmForPeriodto, "long")#</cfoutput>. Your manager,
<cfoutput>#empForm.txtManagerName#</cfoutput>, will notify you upon approval.</p>
HTTP post example
The following example shows how to extract data from a PDF form submitted with HTTP post and use it to update an
employee database. The form was created in LiveCycle Designer.
On the ColdFusion login page, an employee enters a user name and password:
<!--- The following code creates a simple form for entering a user name and password. The code
does not include password verification. --->
<h3>Employee Update Login Form</h3>
<p>Please enter your user name and password.</p>
<cfform name="loginform" action="loginform_procHTTP.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 first processing page, a query retrieves all of the information associated with the user name from the
cfdocexamples database. The
employeeInfoHTTP.pdf) with the employee name, phone number, e-mail address, and department. The form also
includes the employee ID as a hidden field. ColdFusion displays the populated form in the browser where the employee
can change personal information in the form and submit it.
tag populates an associated PDF form created in LiveCycle Designer (called
cfpdfform
Last updated 1/20/2012
925

Advertisement

Table of Contents
loading

This manual is also suitable for:

Coldfusion 9

Table of Contents