Adobe COLDFUSION 9 Manual page 945

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

Advertisement

DEVELOPING COLDFUSION 9 APPLICATIONS
Working with Documents, Charts, and Reports
• Create PDF packages
To merge the contents of a directory, use the
located, as the following example shows:
<cfpdf action="merge" directory="c:/BookFiles" destination="myBook.pdf" overwrite="yes">
By default, ColdFusion merges the source files in descending order by timestamp. You can control the order in which
the PDF files are added to the book by setting the
in ascending order according to the timestamp on the files:
<cfpdf action="merge" directory="c:/BookFiles" destination="myBook.pdf" order="name"
ascending="yes" overwrite="yes">
By default, ColdFusion continues the merge process even if it encounters a file that is not a valid PDF document in the
specified directory. To override this setting, set the
<cfpdf action="merge" directory="c:/BookFiles" destination="myBook.pdf" order="time"
ascending="yes" overwrite="yes" stopOnError="yes">
You can merge a comma-separated list of PDF files. To do this merge, specify the absolute path for each file, as the
following example shows:
<cfpdf action="merge"
source="c:\coldfusion\wwwroot\lion\Chap1.pdf,c:\coldfusion\wwwroot\lion\Chap2.pdf"
destination="twoChaps.pdf" overwrite="yes">
For more control over which files are added to the merged document, use the
tag merges documents or pages from documents located in different directories into a single output file.
cfpdfparam
When you use the
cfpdfparam
the following example, the cover, title, and copyright pages are followed by the first five pages of the introduction, then
all of the pages in Chapter 1, and then the first page followed by pages 80–95 in Chapter 2:
<!--- Use the cfdocument tag to create PDF content and write the output to a variable called
coverPage.--->
<cfdocument format="PDF" name="coverPage">
<html>
<body>
<h1>Cover page</h1>
<p>Please review the enclosed document for technical accuracy and completeness.</p>
</body>
</html>
</cfdocument>
<!--- Use the cfpdf tag to merge the cover page generated in ColdFusion with pages from PDF
files in different locations. --->
<cfpdf action="merge" destination="myBook.pdf" overwrite="yes" keepBookmark="yes">
<cfpdfparam source="coverPage">
<cfpdfparam source="title.pdf">
<cfpdfparam source="e:\legal\copyright.pdf">
<cfpdfparam source="boilerplate\intro.pdf" pages="1-5">
<cfpdfparam source="bookfiles\chap1.pdf">
<cfpdfparam source="bookfiles\chap2.pdf" pages="1,80-95">
</cfpdf>
Because the
attribute is set to
keepbookmark
the output file.
Note: You cannot use the
cfpdf
action and specify the directory where the source PDF files are
merge
and
order
ascending
stopOnError
tag, the PDF files are added to the output file in the order they appear in the code. In
, ColdFusion retains the bookmarks from the source documents in
yes
tag to create bookmarks in a PDF document.
Last updated 8/5/2010
attributes. The following code merges the files
attribute to
, as the following example shows:
yes
tag with the
cfpdfparam
940
tag. The
cfpdf

Advertisement

Table of Contents
loading

Table of Contents