3

I'm using ColdFusion to generate a PDF and creating a DDX file that will generate the TOC for the file when it's done. I can configure and format a header for the TOC page, but have not been able to find anything anywhere on how to change the font of the actual, generated TOC.

Here's my DDX file code:

<cfsavecontent variable="ddxFile"><?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> 
            <Header styleReference="TOCheaderStyle"/> 
        </TableOfContents> 
        <PDF source="Doc1"/>
    </PDF> 
    
    <StyleProfile name="TOCheaderStyle"> 
        <Header> 
            <Center> 
                <StyledText> 
                    <p font-weight="bold" font="Arial">Table of Contents</p> 
                </StyledText> 
            </Center> 
        </Header>       
    </StyleProfile>    
</DDX>  
</cfsavecontent>

I have been searching for an answer for about a week now with no luck on how to get to actual font setting of the generated table of contents text.

Any help would be greatly appreciated! Thanks!

mwill81
  • 115
  • 7
  • 1
    [This old example](https://www.carolinamantis.com/wordpress/?p=151&cpage=1) worked for me. – SOS Feb 26 '21 at 02:42
  • Thanks for the link! Doesn't seem to be working for me on CF2018, version 2018,0,10,320417. I just keep getting "The DDX specified is not valid." I'm not using LiveCycle with this, just ColdFusion. What CF version did you run it on? – mwill81 Feb 26 '21 at 14:59
  • It's update 2018,0,05,315699. Run this test code to see if it works for you as written. If not, I'll try updating to v10,320417. https://pastebin.com/cjgtXS55 See also [Assembler DDX Docs](https://help.adobe.com/en_US/livecycle/10.0/ddxRef.pdf) – SOS Feb 26 '21 at 20:43
  • Finally figured out what I was doing wrong! That worked! Thank you so much! – mwill81 Mar 01 '21 at 12:42
  • Great! You should post your final code as an answer, in case someone else has the same problem. – SOS Mar 02 '21 at 23:50

1 Answers1

1

Here's the code I'm generating thanks to the link provided by SOS:

<cfsavecontent variable="myDDX">
<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 includeInTOC="false" bookmarkTitle="Table of Contents">
        <TableOfContentsEntryPattern applicableLevel="all" >
            <StyledText>
                <p font-family="Times New Roman" font-size="12pt">
                    <_BookmarkTitle/>
                    <Space/>
                    <Space/>
                    <leader leader-pattern="dotted"/>
                    <Space/>
                    <Space/>
                    <_BookmarkPageCitation/>
                </p>
            </StyledText>
        </TableOfContentsEntryPattern>
    </TableOfContents>
    <PDFGroup>
        <PDF source="Doc1" />
        <PDF source="Doc2" />
    </PDFGroup>
    </PDF>
</DDX>
</cfsavecontent>
<cfif IsDDX(#myDDX#)>
    <cfset inputStruct = StructNew()>
    <cfset inputStruct.Doc1 = "FirstDocument.pdf">
    <cfset inputStruct.Doc2 = "SecondDocument.pdf">
    <cfset outputStruct = StructNew()>
    <cfset outputStruct.Out1 = "CombinedDocument.pdf">
    <cfpdf action="processddx" ddxfile="#myddx#" inputfiles="#inputStruct#" outputfiles="#outputStruct#" name="ddxVar">
    <cfdump var="#ddxVar#">
<cfelse>
    <cfoutput><p>NO, DDX IS NOT OK</p></cfoutput>
</cfif>
mwill81
  • 115
  • 7