22.08.2013 Views

ColdFusion Developer's Guide

ColdFusion Developer's Guide

ColdFusion Developer's Guide

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Beta Beta Beta Beta Beta Beta Beta Beta Beta Beta<br />

■ Merge individual PDF files, and pages within those files, explicitly, even if the source files<br />

are stored in different locations.<br />

■ Merge the contents of a PDF variable generated by the cfdocument tag or a cfpdf tag<br />

To merge the contents of a directory, use the merge action and specify the directory where the<br />

source PDF files are located, as the following example shows:<br />

<br />

By default, <strong>ColdFusion</strong> merges the source files in descending order by timestamp. You can<br />

control the order in which the PDF files are added to the book by setting the order and<br />

ascending attributes. The following code merges the files in ascending order according to the<br />

timestamp on the files:<br />

<br />

By default, <strong>ColdFusion</strong> continues the merge process even if it encounters a file that is not a<br />

valid PDF document in the specified directory. To override this setting, set the stopOnError<br />

attribute to yes, as the following example shows:<br />

<br />

You can merge a comma-separated list of PDF files. To do this, you must specify the absolute<br />

pathname for each file, as the following example shows:<br />

<br />

For more control over which files are added to the merged document, use the cfpdfparam tag<br />

with the cfpdf tag. The cfpdfparam tag merges documents or pages from documents located<br />

in different directories into a single output file. When you use the cfpdfparam tag, the PDF<br />

files are added to the output file in the order they appear in the code. In the following<br />

example, the cover, title, and copyright pages are followed by the first five pages of the<br />

introduction, then all of the pages in Chapter 1, and then the first page followed by pages 80–<br />

95 in Chapter 2:<br />

<br />

<br />

<br />

<br />

Cover page<br />

Please review the enclosed document for technical accuracy and<br />

completeness.<br />

<br />

<br />

1062 Assembling PDF Documents

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!