cfform to generate dynamic PDF forms?
by Rolando on Jan.14, 2008, under ColdFusion
I’m trying to figure out if there’s a way to generate dynamic PDF forms with ColdFusion or anything at all and ran into this at CFFORM reference page for CF8:
| Incorporating interactive fields in PDF forms
ColdFusion 8 lets you use the cfform tag to create PDF forms that contain static and interactive form fields. The cfform tag must exist within a cfdocument tag (where format=”pdf”). Only one cfform tag can exist within a cfdocument tag. Completed forms can be posted to the server as an HTTP Post, or the entire PDF can be submitted as binary stream. If the PDF is submitted, you can use the cffile tag to save completed PDF form to a hard drive: <cffile action=”write” file=”c:\savedpdf.pdf” output=”#PDF.content#”> The output can be manipulated and extracted by using the tag. Only the following cfform attributes are supported in generating PDF forms:
To embed an existing PDF form generated by LiveCycle Designer or Acrobat, use the tag. |
Then they provide the following example which has some obvious errors:
A simple PDF form
<cfdocument format="pdf">
<cfdocumentsection ../>
...
...
<cfform type="html/xform">
<cfinput type="textbox" name="employeeName" value="#fullName#"
readonly="true">
<cfinput type="textbox" name="employeeID" value="#id#" readonly>
<cfselect name="contributionPercentage" options="#optionsStruct#"
required="true">
<cfinput type="submit" name="SubmitAsHTTPPost">
<cfinput type="submit" name="SubmitAsPDF" submitType="PDF">
</cfform>
...
...
<cfdocumentsection ../>
</cfdocument>
|
Of course I got all excited about it but after several attempts all I got was a
PDF document that looked like a form but that didn’t work at all. It was merely
a PDF Document.
So I wonder, is this a big goof from Adobe or can you really create dynamic PDF forms with ColdFusion (without any LiveCycle interaction).



January 14th, 2008 on 8:23 pm
I have asked this question at several conferences from the Adobe folk, and the answer is always the same:
You can’t create dynamic PDF forms without a LiveCycle licence.
That being said, you CAN do it with native iText calls, but you do lose some of the advanced functionality (i.e. offline saves) that you can get with liveCycle.
January 15th, 2008 on 4:02 am
That’s what I thought, but at the same time it makes me ask how such *detailed* documentation errors would slip through? They use the word “create” not “populate”.
I wonder if this was an actual feature of CF8 that was put on hold or even if it’ll be a feature of CF9 which would be great, of course.
January 15th, 2008 on 10:40 pm
They’ve responded to my question in the cfform reference page:
http://livedocs.adobe.com/coldfusion/8/htmldocs/help.html?content=Tags_f_13.html
From Adobe:
“The documentation is incorrect.
You cannot create dynamic PDF forms in ColdFusion 8; you can only manipulate of fill them.
For more information see cfpdfform.”
February 1st, 2008 on 1:55 am
Itseasy. Get variables from your database using , then put variables into the following FDF structure:
%FDF-1.2
1 0 obj
>
>
>
>
/F (http://location of PDF Form)
>>
>>
endobj
trailer
>
%%EOF
February 1st, 2008 on 1:57 am
Well, the stuff I typed in didn’t come out. Email me direct and I’ll give you an example of how to dynamicly fill a PDF form from ColdFusion 5,6,7,8