Usage
The Ortus PDF extension will give you the following available tags:
cfpdfform
cfpdfformparam
cfpdfform/cfpdfformparam
This tag allows you to manipulate existing PDF forms, usually edited in Adobe Acrobat or LiveCycle Designer. You will be able to do the following:
Embed a form with pre-filled FORM data and deliver it via
cfcontent or cfpdf or cfdocument
tagsRender out a pre-filled FORM to disk with overwrite and flattening capabilities.
Extract values from a PDF form as:
CFML Structure
XML string
XML file
FDF file
Basic Usage
The cfpdfform
tag can have nested cfpdfformparam
tags in order to populate forms inside PDF documents.
cfpdfform
attributes
cfpdfform
attributesParameter
Required
Action
Default
Description
action
Yes
---
read
Action to perform: populate or read
destination
Yes
populate
---
Pathname for the output file. You can specify an absolute pathname or a pathname relative to the context root. The file extension must be PDF. Do not specify the destination when you embed a form in a PDF document.
overwrite
No
populate, read
No
Specifies whether to overwrite the destination file (if action="populate") or the data file (if action="read"):
overwriteData
No
populate
No
If enabled it will overwrite form field values, else it will only override them if the value is empty.
result
No
read
pdfdata
ColdFusion structure that contains the form field values. If not used, the tag will create a variable called pdfdata
for you in the caller
scope.
source
Yes
populate, read
---
Pathname of the source PDF (absolute on-disk or in-memory path, or path relative to the context root) or byte array representing a PDF.
flatten
No
populate
true
Will flatten the populated PDF so the form is sealed in the container PDF.
structData
No
populate
---
Instead of using nested cfpdfformparam
tags, you can pass a struct of name-value pairs to populate a PDF form with.
jsonData
No
populate,read
---
Populate: Instead of using nested cfpdfformparam
tags, you can pass a JSON object of name-value pairs to populate a PDF form with.
Read : If a string, this will be the name of the variable in the caller's variables
scope that will contain the form data as a JSON string.
xmlData
No
read, populate
---
Read : If a string, this will be the name of the variable in the caller's variables
scope that will contain the Form data as an XML packet value. If this is a file path ending in .xml
then the tag will export the XMl of the Form data to that file.
Populate : The XML object, XML string or XML data filename to use when populating the PDF form instead of sub cfpdfformparam
tags.
cfpdfformparam
attributes
cfpdfformparam
attributesParameter
Required
Default
Description
name
Yes
---
The name of the PDF form entry
value
Yes
---
The value of the PDF form entry
index
---
---
''Not implemented by Ortus PDF''
Examples
Populating a PDF Form with sub params
Populating a PDF Form with a struct
Populating a PDF Form with a JSON object
Populating a PDF Form from and XML file and stream to browser
Reading a PDF Form
Reading a PDF Form as JSON Data
Reading a PDF Form as XML Data
Reading a PDF Form as XML Data into an XML output file
Reading a PDF Form in FDF format and outputting to a file
XML Data
If you will be populating forms or extracting forms, the format in XML will be the following:
Last updated