Adobe COLDFUSION 9 Manual page 956

Developing applications
Hide thumbs Also See for COLDFUSION 9:
Table of Contents

Advertisement

DEVELOPING COLDFUSION 9 APPLICATIONS
Working with Documents, Charts, and Reports
<cfif IsDDX("documentText.ddx">
<cfset ddxfile = ExpandPath("documentText.ddx")>
<cfset sourcefile1 = ExpandPath("book1.pdf")>
<cfset destinationfile = ExpandPath("textDoc.xml")>
<cffile action="read" variable="myVar" file="#ddxfile#"/>
<cfset inputStruct=StructNew()>
<cfset inputStruct.Doc1="#sourcefile1#">
<cfset outputStruct=StructNew()>
<cfset outputStruct.Out1="#destinationfile#">
<cfpdf action="processddx" ddxfile="#myVar#" inputfiles="#inputStruct#"
outputfiles="#outputStruct#" name="ddxVar">
<!--- Use the cfdump tag to verify that the PDF files processed successfully. --->
<cfdump var="#ddxVar#">
</cfif>
The XML file conforms to a schema specified in doctext.xsd. For more information, see
http://ns.adobe.com/DDX/DocText/1.0
When you specify more than one source document, ColdFusion aggregates the pages into one file. The following
example shows the DDX code for combining a subset of pages from two documents into one output file:
<?xml version="1.0" encoding="UTF-8"?>
<DDX xmlns="http://ns.adobe.com/DDX/1.0/"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://ns.adobe.com/DDX/1.0/ coldfusion_ddx.xsd">
<DocumentText result="Out1">
<PDF source="doc1" pages="1-10"/>
<PDF source="doc2" pages="3-5"/>
</DocumentText>
</DDX>
FDF format support for AcroForms
PDF Acro Form now support the Forms Data Format (FDF). You can now export, import, and populate Acroforms
in FDF using the read and populate actions. The action attribute of the
, where you provide the name of the PDF form to be exported or imported.
fdfdata
Following is an example of how can export a PDF form in FDF format using the
<cfpdfform source= "acroform_export.pdf" action="read" fdfdata="abc.fdf" >
</cfpdfform>
To import form data:
<cfpdfform source= "write_acrroform.pdf" action="populate" fdfdata="abc.fdf"
destination="hello.pdf">
</cfpdfform>
Form data can now be populated in a PDF document using the
allows you use the FDF format internally. Following code snippet illustrates this feature:
cfpdfform
action. The new
populate
Last updated 8/5/2010
tag contains a new attribute called
action:
read
attribute with populate
fdf
951

Advertisement

Table of Contents
loading

Table of Contents