Copy link to clipboard
Copied
When using DDX to merge certain pdf files, we get the following error:
failed: DDXM_S18005: An error occurred in the PrepareTOC phase while building <TableOfContents>. Cause given.
We are running Coldfusion 9.0.1 on a Windows Server 2008 R2 64-bit server.
The error occurs only on certain pdf files, and only if we include them in the table of contents.
There was a similar bug in Coldfusion 8 that was fixed, but it looks like it's come back again in Coldfusion 9.
merge.cfm:
<CFLOOP LIST="merge_no_toc.ddx,merge_toc.ddx" INDEX="ddx">
<CFLOOP LIST="good.pdf,bad.pdf" INDEX="pdf">
<CFSET inputStruct = StructNew()>
<CFSET StructInsert(inputStruct, "In1", pdf)>
<CFSET StructInsert(inputStruct, "In2", pdf)>
<CFSET outputStruct = StructNew()>
<CFSET outputStruct.Out1 = "merged.pdf">
<CFPDF ACTION="processddx" DDXFILE="#ddx#" INPUTFILES="#inputStruct#" OUTPUTFILES="#outputStruct#" NAME="merge"></CFPDF>
<CFOUTPUT>#DDX# with #pdf#:</CFOUTPUT>
<CFDUMP VAR="#merge#">
<BR />
</CFLOOP>
</CFLOOP>
merge_toc.ddx
<?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">
<TableOfContents bookmarkTitle="Table Of Contents" maxBookmarkLevel="1" includeInTOC="false">
<Header>
<Center>
<StyledText>
<p color="black" font-size="16pt">Table of Contents</p>
<p />
<p />
</StyledText>
</Center>
</Header>
</TableOfContents>
<PDF source="In1" bookmarkTitle="1" includeInTOC="true">
<PageLabel mode="Define" start="_PageNumber"/>
</PDF>
<PDF source="In2" bookmarkTitle="2" includeInTOC="true">
<PageLabel mode="Define" start="_PageNumber"/>
</PDF>
</PDF>
</DDX>
merge_no_toc.ddx
<?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">
<TableOfContents bookmarkTitle="Table Of Contents" maxBookmarkLevel="1" includeInTOC="false">
<Header>
<Center>
<StyledText>
<p color="black" font-size="16pt">Table of Contents</p>
<p />
<p />
</StyledText>
</Center>
</Header>
</TableOfContents>
<PDF source="In1" bookmarkTitle="1" includeInTOC="false">
<PageLabel mode="Define" start="_PageNumber"/>
</PDF>
<PDF source="In2" bookmarkTitle="2" includeInTOC="false">
<PageLabel mode="Define" start="_PageNumber"/>
</PDF>
</PDF>
</DDX>
The resulting output:
The "bad" pdf is a perfectly normal PDF with the Helvetica font (this is what the copier does).
The "good" pdf is a perfectly normal PDF from a different copier, without the Helvetica font.
The fonts available, as listed by the ColdFusion Administration page, include ArialMT and Helvetica:
The good and bad pdf files, as well as the ddx and cfm files can be downloaded here if you want to run it yourself: http://dl.dropbox.com/u/55552656/merge.zip
Copy link to clipboard
Copied
If you know which version fixed the issue, I would say try the same code under that version. If it does not work, you may be looking at a different issue. Did you check the bug database?
I think the "bad" file contains an embedded font, so it should work. But I ran a quick test with CF9 and CF8.0.1 and got the same error under both. Strangely doing a "merge" (on just the bad file) first, generated a new pdf that worked with the table of contents.
Copy link to clipboard
Copied
I think 8.0.1 was supposed to fix the problem. But since it's not fixed in 9 (and you said you tried it in 8.0.1) that leads me to believe that it's not the same problem, or that the "fix" was to make the thing fail silently and not stop page processing. If you just search for the error message you'll find only a handful of results mentioning it.
I've filed a bug report but suprise surprise, no response as usual.
Copy link to clipboard
Copied
If it is in 8.0.1 specifically, and not a separate hotfix or something, then yes that suggests it may be a slightly different issue.
I've filed a bug report
Can you post a link to the bug report?
Copy link to clipboard
Copied
https://bugbase.adobe.com/index.cfm?event=bug&id=3192782
I learned about the 8.0.1 part from here: