Adobe 38043740 - ColdFusion Standard - Mac Development Manual page 944

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
<cfpdf action="write" source="confidential.pdf" password="paSSword1"
destination="myDocument.pdf">
Managing PDF document information
To retrieve information stored with a source PDF document, such as the creation date, the application used to create
the PDF document, and the name of the person who created the document, use the
elements, see PDF file information elements in the CFML Reference.
Use the
action to specify information, such as the author, subject, title, and keywords associated with the
setInfo
output file. This information is useful for archiving and searching PDF documents. PDF document information is not
displayed or printed with the document.
The following example shows how to set keywords for tax documents. The information is useful for assembling the
documents based on the tax filing requirements for different business types (Sole Proprietor, Partnership, and S
Corporation). Some business types share the same forms and documents. By setting the business type keywords for
each document, you can store the documents in one directory and search them based on keyword values. The
following code sets three keywords for the p535.pdf tax booklet:
<cfset taxKeys=StructNew()>
<cfset taxKeys.keywords="Sole Proprietor,Partnership,S Corporation">
<cfpdf action="setInfo" source="taxes\p535.pdf" info="#taxKeys#"
destination="taxes\p535.pdf" overwrite="yes">
When you use the
setInfo
previous example, if the pc535.pdf document contained a keyword of "tax reference", ColdFusion overwrites that
keyword with "Sole Proprietor, Partnership, S Corporation".
To retrieve all of the information associated with the tax file, use the
following example shows:
<cfpdf action="getInfo" source="taxes\p535.pdf" name="taxInfo">
<cfdump var="#taxInfo#">
To retrieve just the keywords for the PDF document, use this code:
<cfpdf action="getInfo" source="taxes\p535.pdf" name="taxInfo">
<cfoutput>#taxInfo.keywords#</cfoutput>
Using the name attribute with write action
You can now use the name attribute with <cfpdf action = "write"> and specify a variable name for your PDF document.
For example:
<cfpdf action="write" source="myBook" name=#myBook# version="1.4">
This feature is available with both
Merging PDF documents
ColdFusion lets you merge PDF documents in the following ways:
• Merge all of the PDF files in a specified directory.
• Merge a comma-separated list of PDF files.
• Merge individual PDF files, and pages within those files, explicitly, even if the source files are stored in different
locations.
• Merge the contents of a PDF variable generated by the
action, ColdFusion overwrites any existing information for that key-value pair. In the
and
cfpdf
cfpdfform
Last updated 1/20/2012
getInfo
tag with the
cfdump
tags.
tag or a
cfdocument
cfpdf
action. For a list of data
action, as the
getInfo
tag
939

Advertisement

Table of Contents
loading

This manual is also suitable for:

Coldfusion 9

Table of Contents