Skip navigation
bw_bloodletter
Currently Being Moderated

failed: DDXM_S18005: An error occurred in the PrepareTOC phase while building <TableOfContents>.

May 17, 2012 11:47 AM

Tags: #cfpdf #ddx #cf9

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:

output.jpg

 

The "bad" pdf is a perfectly normal PDF with the Helvetica font (this is what the copier does).

bad.jpg

 

The "good" pdf is a perfectly normal PDF from a different copier, without the Helvetica font.

bad.jpg

 

The fonts available, as listed by the ColdFusion Administration page, include ArialMT and Helvetica:

fonts.jpg

 

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

 
Replies

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points