Monday, September 17, 2007

Simple TOC example

I am posting here a simple Table Of Contents(TOC) example using cfpdf.
 
The 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">
      <TableOfContents maxBookmarkLevel="infinite" bookmarkTitle="Table of Contents" includeInTOC="true">
      </TableOfContents>
      <PDF source="Doc1"/>
      <PDF source="Doc2"/>
   </PDF>
</DDX>
 
The CFM File
==========================
<cfset ddxfile = ExpandPath('ddxfiles/toc.ddx')>
<cfset sourcefile1 = ExpandPath('inputfiles/ddx_test1.pdf')>
<cfset sourcefile2 = ExpandPath('inputfiles/ddx_test2.pdf')>
<cfset destinationfile = ExpandPath('results/ddx_result-toc.pdf')>
 
<cfset inputStruct=StructNew()>
<cfset inputStruct.Doc1="#sourcefile1#">
<cfset inputStruct.Doc2="#sourcefile2#">
 
<cfset outputStruct=StructNew()>
<cfset outputStruct.Out1="#destinationfile#">
 
<cfpdf action="processddx" ddxfile="#ddxfile#" inputfiles="#inputStruct#" outputfiles="#outputStruct#" name="ddxVar">
 
<cfoutput>#ddxVar.Out1#</cfoutput>

1 comment:

pakistannationalnews said...

"Man Pasand Shadi"">Rohani Wazifa"">Taweezat"">Black magic
"
The Istikhara is an Islamic tradition which is strongly rooted in our culture of Iran, India and Pakistan. Amil Bangali Baba"