Hi. This page is for people who saw my presentation on XML at the 2002 Macromedia DevCon conference and would like to play with the ability to create PDF documents via XML and XSLT. You'll need to download and install FOP to get the PDF generation working. FOP is an open source renderer of XSL-FO documents. FOP does a number of things, but its main purpose in life is to accept XSL-FO code and turn it into a PDF document. If you're not familiar with XSL-FO, just think of it as being like HTML, but for printable document formats (like PDF) instead of web pages.
In any case, here's what you need to do.
For purposes of this discussion, the file you are most interested in here is the ExampleApp\FOP.cfc file from my presentation examples. It's a ColdFusion Component (CFC) that is essentially just a wrapper around the CF code needed to talk to FOP using its Java API. It makes FOP easy to use in CF code.You can either use the CFC as-is, or you can study the guts of FOP.cfc to learn how to create your own code for talking to FOP.
Currently, the CFC exposes two methods:
In either case, the first argument is the XSL-FO input (which you can provide as a string or a filename on the server's drive) and the second argument is the path to write the completed PDF file to. The input is most likely the result of an XSLT transformation that you perform with CFMX's XmlTransform() function. The output would most likely then be sent to the browser using <CFCONTENT> (possibly using DeleteFile="Yes" so the file is deleted after the user gets it). Example code is in the ExampleApp\Transformer.cfc file from my DevCon examples.
The CFC takes care of simple locking and other safeguards internally. You are encouraged to take a look the FOP.cfc file to see how it works, learning a bit about CFC's along the way.
nate