340 likes | 922 Views
Creating PDF Documents Using ColdFusion & activePDF. Matteo Foschetti Technical Evangelist activePDF Inc. Introduction. Technical Evangelist Software Engineer Corporate Trainer Conference Speaker Web Programming Instructor. Agenda. Learn About activePDF Inc.
E N D
Creating PDF Documents Using ColdFusion & activePDF Matteo Foschetti Technical Evangelist activePDF Inc.
Introduction Technical Evangelist Software Engineer Corporate Trainer Conference Speaker Web Programming Instructor
Agenda Learn About activePDF Inc. Discuss PDF & COM Technology Review ColdFusion MX Introduce activePDF Toolkit & WebGrabber Demonstrate activePDF Examples
Survey PDF COM ColdFusion/ColdFusion MX <CFOBJECT> Tag activePDF
About activePDF Inc. Provider of server-side PDF conversion and development tools PDF tools free the developer from the dilemmas associated with dynamic PDF creation Unique in PDF industry by offering a server-based suite of products
About activePDF Inc. No additional per user or per document licensing fees COM object level access within all the activePDF products Complete control over the PDF generation and manipulation process
What is PDF? Portable Document Format Widespread standard among users for file sharing and exchanges Platform-independent for viewing on any machine PDF is well integrated in almost every industry
What is COM? Component Object Model A specification and set of services to enable component portability, reusability, and versioning Promotes component-based development
What is COM? Referred to as objects, controls or components Contain properties (attributes) and methods (operations) Callable from any environment that supports COM, such as ColdFusion, Visual Basic, ASP, etc.
The Typical PDF Conversion Process A PostScript file is generated by printing from a native application to a PostScript enabled device by a user A PDF generator application is opened
The Typical PDF Conversion Process PostScript File is located File parameters and output options are selected PostScript-To-PDF conversion takes place User repeats steps 1-5 for each unique document
What is Server-Side PDF Conversion? activePDF software resides on a network server Allows automatic file conversion without user intervention Alleviates the “guesswork” Allows full control over security and display settings of documents
ColdFusion MX Overview Latest ColdFusion Application Server Parses (reads and compiles) supplied instructions Processes supplied instructions Instructions passed to ColdFusion using templates
ColdFusion MX Templates ColdFusion pages that use ColdFusion Markup Language (CFML) Extend HTML by adding tags with a variety of capabilities <CF….> Variables and functions are surrounded by pound signs #….#
CFML & ColdFusion Features Files use the file extension .cfm or .cfml Capable of Linking to External Data Applications Integration with C/C++, Java, COM, CORBA, and Web Services
Getting Started with COM and ColdFusion Component objects can be invoked in ColdFusion using tags <CFOBJECT> creates an instance of an object <CFSET> invokes properties and methods of the object <CFOUTPUT> displays text
Using Properties To set a property: <cfset obj.property = “somevalue”> To get a property: <cfset value = obj.property>
Calling Methods Methods with no arguments: <cfset retVal = obj.Method1()> Methods with one or more arguments: <cfset x = 23> <cfset retVal = obj.Method1(x, “a string literal”)>
Calling Methods Methods with reference arguments: <cfset x = 23> <cfset retVal = obj.Method2(“x”, “a string literal”)> Calling nested objects: <cfset objX = myObj.X> <cfset prop = objX.Property>
Registering COM Objects In order for ColdFusion to find the COM object, you must register it With Windows, you use the regsvr32 command with the object file (*.dll, *.ocx), such as: regsvr32 c:\path\servername.dll
Creating & Using COM Objects in ColdFusion Note: You must create the component in ColdFusion before your application pages can invoke any methods or assign any properties in the component!
Creating & Using COM Objects Example <!--- First, create the object ---> <cfobject type=“COM” action=“Create” name=“Mailer” class=“CDONTS.NewMail”> <cfset Mailer.To = “#Form.to#”> <cfset Mailer.Body = “#Form.body#”> <!--- Last, use the Send() method to send the msg ---> <cfset Mailer.Send()>
What is activePDF Toolkit? Programmable COM object that enables users to create and manipulate PDF documents With a robust API, ToolKit is used to append, stamp, stitch, merge, paint, form-fill, etc.
Toolkit Features Simple to add watermarks, set form fields, incorporate headers and footers, extracting ,concatenating pages, etc. ToolKit supports latest encryption standards and other unique PDF technologies
Toolkit Basic Steps for Form-Filling a PDF Open an output destination file (OpenOutputFile Method) Open an input PDF form (OpenInputFile Method) Set the form field values (SetFormFieldData Method) Copy the input form into the destination file (CopyForm Method) Close output destination file (CloseOutputFile)
Toolkit Examples PDF Form-Filling Dynamic PDF Report Generation
What is activePDF WebGrabber? Programmable COM object that dynamically converts any URL, HTML stream, or HTML file to PDF Designed for use with activePDF Server as a Multi-Threaded application
WebGrabber Features Capable of using either the default HTML 3.2 rendering engine or the Microsoft Internet Explorer engine which supports CSS, SSL, Flash, Java, etc. Supports latest Encryption standards and Linearization
WebGrabber Basic Steps Spooling Stage: activePDF WebGrabber is responsible for rendering the HTML Conversion Stage: activePDF Server is then responsible for producing the PDF document (Multi-threaded)
WebGrabber Examples On-the-fly HTML to PDF Web Reporting to PDF
Conclusion activePDF provides server-side PDF conversion and development tools PDF is a widespread standard among users for file sharing and exchanges
Conclusion activePDF COM objects allow full control over security and display settings of documents Component objects can be invoked in ColdFusion using tags, such as <CFOBJECT>
Conclusion activePDF Toolkit enables users to create and manipulate PDF documents activePDF WebGrabber dynamically converts any URL, HTML stream, or HTML file to PDF
References Forta, B., Weiss, N., (2003). Macromedia ColdFusion MX Web Application Construction Kit. (5th ed.). Berkeley, CA: Macromedia Press. Macromedia. (2001). Macromedia ColdFusion5 Developing ColdFusion Applications. Macromedia Incorporated. Balena, F. (1999). Programming Microsoft Visual Basic 6.0. Redmond, WA: Microsoft Press. activePDF Inc. (2003). activePDF Press Kit. Retrieved May 12, 2003, from http://www.activepdf.com/en/Corporate/PressKit.asp