OK so I'm trying to do a simple test using DDX to generate a table of contents. I am using some sample code I found that is as basic as you get just to get it to work and then modify it. No matter what I try though, my Table of Contents is empty or I should say the Table of Contents page doesn't get created at all. Has anyone seen this before?
My DDX FILE
<?xml version="1.0" encoding="UTF-8"?>
My test file
<cfset ddxfile = "toc.ddx">
<cfset sourcefile1 = "c:\20225230_ESS.pdf">
<cfset sourcefile2 = "c:\20225230_MS.pdf">
<cfset destinationfile = "c:\foo.pdf">
<cfpdf action="processddx" ddxfile="#ddxfile#" inputfiles="#inputStruct#" outputfiles="#outputStruct#" name="ddxVar">
Well I didn't get any help on this one, but I did figure out what was going on for anyone else having this same issue. It turns out that in order to use a "Table of Contents" your PDF pages must have bookmarks for each section you want included in the TOC. So if you were creating your PDF's from scratch using CFDOCUMENT, you would need to do this:
<cfdocument format="pdf" filename="foo.pdf" overwrite="true" bookmark="true">
<cfdocumentsection name="Section 1">
BLAH BLAH BLAH
Notice that bookmark is set to true and there is a cfdocumentsection surrounding the entire doc. Now obviously you can have multiple sections in your PDF which would show up as separate pages in your PDF and separate entries in the TOC. The name you give to the document section is what shows up as the entry in the TOC.
SOOO this does answer problem 1, now does anyone know how I can get the TOC to work for PDF's I DID NOT create manually with CFDOCUMENT like ones that are already sitting on my system created by some other means that most likely do not have bookmarks? How can I include these other pdfs in the TOC? Is there a way to add bookmarks to already created PDF's?