Mark, here is a quick answer and a reference to MY
frustrating problem :-)
What you described is the PDF table of contents functionality
that now works in CF 8.01 (there was a bug in 8.0). You can create
a table of contents by including the Table of Contents node in your
ddx 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">
<PDF result="Out1">
<PDF source="Title">
<TableOfContents/>
<PDF source="Doc1"/>
<PDF source="Doc2"/>
</PDF>
</DDX>
This example results in a cover page (Title), a table of
contents, and two PDFs (Doc1 & Doc2) concatenated into a single
PDF file (Out1). Couple of key points:
1. I don't know if others have had this problem, but I've had
no success storing and reading a ddx file from the server, so I
generate that dynamically within <cfsavecontent
variable="ddxBook">. This is actually a good thing, since I can
use queries or XML functions to generate the ddx file dynamically.
2. As per the "CF Developer's Guide::Assembling PDF
Documents::Using DDX to Perform Advanced Tasks::Adding a table of
contents" you create input and output structs containing the
filenames of docs to merge, and the destination of the merged file.
Be sure to read this section; it will help.
3. You can use style references in the ddx to make your Table
of Contents look like you want. (There is an example in the
"Applications Examples" in the above section.) Each entry will be a
bookmark name (doc title) and page number, as a hyperlink to the
docs, which is what you want:
<TableOfContents maxBookmarkLevel="1" bookmarkTitle="Table
of Contents" includeInTOC="false">
<Header styleReference="TOCheaderStyle"/>
<Footer styleReference="TOCFooterStyle"/>
<TableOfContentsEntryPattern applicableLevel="1" >
<StyledText>
<p font="Arial,11pt">
<_BookmarkTitle/><leader
leader-pattern="dotted"/>
<_BookmarkPageCitation/>
</p>
</StyledText>
</TableOfContentsEntryPattern>
</TableOfContents>
You can specify what to use for the bookmark like this
example (where the docTitle is in a query and the variable
doc#qBook.currentRow# represents the filenames in an input struct):
<cfoutput query="qBook"><PDF
source="doc#qBook.currentRow#"
bookmarkTitle="#xmlFormat(docTitle)#" /></cfoutput>
The problem I have been having is that the page numbers are
set by any PRE-EXISTING bookmarks/page numbers in the PDFs I am
assembling, so no matter what I do, some PDFs keep showing up in
the Table of Contents as page 1. So the pages go like this:
3,1,4,1,10,129,1,262,1,1,266,295,1,298,1, etc. The page numbers in
the footers I applied in the ddx are fine, they just come out funky
on the table of contents.
You can read my post in the Advanced Techniques area. If I
get a resolution to this issue, I will let you know!
Hope this helps point you in the right direction.
Jim