<CFHEADER NAME="Content-Disposition" VALUE="inline; filename=myfilename.fdf">
<CFCONTENT TYPE="application/vnd.fdf">
<cfoutput>#PDFFormOutput#</cfoutput>
Installing CFX_PDFForm
1.) Copy the PDFForm.class file into your ColdFusion java folder. On Windows, this folder is usually located at:
CFusionJavaclasses or CFusionMXcfxjava
1a.) Make sure the folder that you copy the PDFForm.class file into is located in the ClassPath in the ColdFusion Administrator.
2.) Go to ColdFusion Administrator in your web browser, then click on CFX Tags (under Extensions)
3.) Click Register Java CFX
4.) For Tag Name, type: CFX_PDFForm For Class Name, type: PDFForm
5.) Submit Changes
DOCUMENTATION
First, create a PDF using Adobe Acrobat. Create fields for any values that you wish to fill into the PDF.
For example, if you wish to fill a persons name and birthdate, create two fields and name them 'personname' and 'persondob'.
Then call cfx_PDFForm like so (assuming the values are in the query string):
<cfx_PDFForm INPUTURL = "http://www.mysite.com/mypdf.pdf"
LISTFIELDS = "personname,persondob"
LISTVALUES = "#url.personname#,#url.persondob#">
Then output the PDF:
<CFHEADER NAME="Content-Disposition" VALUE="inline; filename=trf-#DateFormat(Now(),"yyyy-mm-dd")#.fdf">
<CFCONTENT TYPE="application/vnd.fdf">
<cfoutput>#PDFFormOutput#</cfoutput>
RETURN VARIABLES
PDFFormOutput
Contains the PDF Form data used to fill the PDF File. See above example.
PDFFormMessage
Contains any errors generated by the tag.
SYNTAX
<cfx_PDFForm INPUTURL = "text"
LISTFIELDS = "list"
LISTVALUES = "list"
DELIMITTER = "char">
ATTRIBUTES
Required. The full URL to the PDF file you want to fill with data.
LISTFIELDS
Required. A list (delimitter specified in the DELIMITTER attribute) of fields to populate in the PDF.
Example: LISTFIELDS = "dob;lastname;firstname"
LISTVALUES
Required. A list (delimitter specified in the DELIMITTER attribute) of values to populate the fields specified in LISTFIELDS.
Example: LISTVALUES = "12/19/65;Smith;John"
DELIMITTER [ Default = , (comma) ]
Optional. The delimitter to be used in LISTFIELDS and LISTVALUES.
Example: DELIMITTER = ";"
SUPPORT
Please let us know if you encounter any issues with this tag.
Describe the issue in full, provide any error reports generated or screen captures if necessary.
Please also describe the context in which the error occurred, include any portions of your code that you do not deem to be private or protected.