ColdFusion 8 PDF-Integration Sven Ramuschkat SRamuschkat@herrlich-ramuschkat.de München & Zürich, März 2009
PDF Funktionalitäten 1. Auslesen und Befüllen von PDF-Formularen 2. Umwandlung von HTML-Seiten nach PDF 3. Assembling von PDF-Dokumenten 1. Zusammen-mergen von mehren PDFs zu einem PDF 2. Erzeugen von Thumbnails von PDF-Seiten 3. Hinzufügen von Waterwarks 4. DDX Funktionalitäten 4. Serverseitiges Drucken von PDFs 5. ColdFusion ReportWriter
PDF Forms
PDF Forms CRM ERP Andere Quellen Digitale Signaturen Digitalisierung
LiveCycle PDF Forms (XFA Form) Data Formats Data can be filled only in XML format <form1> <subform1> <name>test Name</name> <empcode>12345</empcode> </subform1> </form1> Dynamic Forms appearance can change to adjust to the supplied data Completely XML based (XDP) Data DOM and Template DOM Submission HTTP Post PDF Document Can be created using Adobe LiveCycle Designer 6
LiveCycle ES Form Designer
CFPDF Form What <CFPDFForm> can do? Populate a static/dynamic XFAForm Extract values from a filled up static/dynamic XFA Form Can post data in HTTP format or entire PDF can be submitted to server What <CFPDFForm> cannot do? It cannot create a PDF Form 8
Auslesen von PDF-Forumlaren Datenstruktur Auslesen Befüllen eines PDFs Demo 1 und 2
Auslesen von PDF-Forumlaren Auslesen der Daten aus einem PDF Demo 3
Umwandlung von HTML nach PDF Demo 4
Zusammen-mergen von PDF-Dateien Demo 5
Erstellen von Thumbails von PDFs Demo 6
Hinzufügen von Watermarks Demo 7
DDX Document Description XML is a declarative markup language whose elements represent building blocks of documents. It can be considered as a template for the document(s) that you want the Assembler service to produce. XML based document definition format to manipulate PDF. Part of Adobe LiveCycle Assembler DDX. Restricted set of features in CF. DDX Document Structure <?xml version="1.0" encoding="utf-8"?> <DDX xmlns="http://ns.adobe.com/ddx/1.0/ xsi:schemalocation schema_location /> <!-- Other DDX elements --> </DDX> 15
DDX Why should you be interested! One time coding Gives complete control over pdf assembly (attributes, features) Supports a very rich feature set Text Extraction TOC Generation Setting headers/ footers Setting initial views Attachments/bookmarks/Annotations/labels The same can be used with Adobe LiveCycle Assembler Easy to use Its Adobe
CFPDF DDX processing Supported using processddx action What can be done using ddx in CF Add a table of contents Add Headers and Footers Format headers and footers Using style profiles Group PDF documents Set the initial view of a PDF document Add text-string watermarks Extract text from a PDF document 17
CFPDF DDX processing Sample DDX <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="false"> <TableOfContentsEntryPattern> <StyledText font="italic"><p> <_BookmarkTitle /> <leader leader-pattern="dotted" /> <_BookmarkPageCitation /></p> </StyledText> </TableOfContentsEntryPattern> </TableOfContents> <PDF source= Doc1" /> <PDF source= Doc2" /> </PDF> 18
CFPDF DDX processing.continued <PDF result="out2"> <Footer> <Right> <StyledText> <p>page <_PageNumber/> of <_LastPageNumber/></p> </StyledText> </Right> </Footer> <Watermark rotation="30" opacity="65%"> <StyledText><p font-size="50pt" font-weight="bold" color="lightgray" font="arial">draft</p></styledtext> </Watermark> <PDF source= Doc2" /> <PDF source= Doc1" /> </PDF> </DDX> Sample Code for DDX processing <cfset input={doc1="c:/source1.pdf, Doc2="C:/Source2.pdf"}> <cfset output={out1="c:/output1.pdf, Out2="C:/Output2.pdf"}> <cfpdf action="processddx" ddxfile= sample.ddx" inputfiles="#input#" outputfiles="#output#" name="statusstruct"> 19
CFPrint <cfprint> tag for Server side printing GetPrinterInfo(printerName) - set of attributes that the named printer supports Only supported type is PDF CF Adminisrator lists all printers available and default printer in System Information section <cfprint > type= pdf" source= test1.pdf password= password1 printername= path to printer 20
Questions?