
918
DEVELOPING
COLDFUSION 9 APPLICATIONS
Working with Documents, Charts, and Reports
Las
t
upda
te
d 8/5/2010
In ColdFusion, to prefill the fields in forms created in Acrobat, nest the field names as subforms:
<cfpdfform action="populate" source="acrobatForm.pdf">
<cfpdfsubform name="form1">
<cfpdfsubform name="x">
<cfpdfformparam name="f1" value="AGuthrie">
<cfpdfformparam name="f2" value="123">
<cfpdfformparam name="f3" value="456">
</cfpdfsubform>
</cfpdfsubform>
</cfpdfform>
Often, forms created in LiveCycle contain subforms within the form1 subform. For example, the following grant
application contains nested subforms:
To populate the fields in ColdFusion, map the structure by using nested
cfpdfsubform
tags:
<cfpdfform source="c:\grantForm.pdf" destination="c:\employeeid123.pdf" action="populate">
<cfpdfsubform name="form1">
<cfpdfsubform name="grantapplication">
<cfpdfsubform name="page1">
<cfpdfformparam name="orgAddress" value="572 Evergreen Terrace">
<cfpdfformparam name="orgCity" value="Springfield">
<cfpdfformparam name="orgState" value="Oregon">
...
</cfpdfsubform>
<cfpdfsubform name="page2">
<cfpdfformparam name="description" value="Head Start">
<cfpdfformparam name="pageCount" value="2">
...
</cfpdfsubform>
</cfpdfsubform>
</cfpdfsubform>
</cfpdfform>
Note:
A PDF file can contain only one interactive form. Therefore, if a PDF file contains subforms, a Submit button
submits data for all the subforms simultaneously.
struct
form1
struct
grantapplication
struct
page1
struct
orgAddress
[empty string]
orgCity
[empty string]
orgState
[empty string]
...
...
page2
struct
description
[empty string]
pageCount
[empty string]
...
...