Click to See Complete Forum and Search --> : XML to PDF?


extrovertive
08-24-2007, 12:03 PM
Basically, I have a HTML tables with data and CSS for formatting/style. Now I want to build an XML and somehow export the table to PDF.

I was thinking perhaps transforming the output to build an XML, and then using XSL for style formatting, which then can be render in PDF.


I'm not sure how that process would work.

Stephen Philbin
08-27-2007, 05:11 AM
As far as I know, you'd have to use XSL-FO (http://www.w3.org/TR/xsl/) to convert your document into formatting objects which you can then pass to another program which will take the formatting objects and create a PDF from them.

Charles
08-27-2007, 11:52 AM
Actually, that's a little off. FOP (http://xmlgraphics.apache.org/fop/), Formatting Objects Processor, process formatting objects and turns them into something else. "Output formats currently supported include PDF, PS, PCL, AFP, XML (area tree representation), Print, AWT and PNG, and to a lesser extent, RTF and TXT. The primary output target is PDF." XSLT, XML Stylesheet Language Transformations, was developed to make generating formatting objects easier. When used this way it's called XSL-FO and the two specifications are issued as one.

You can feed FOP an XSL-FO stylesheet and the raw XML or you can feed it FO. And FO you can generate anyway that you like.

Stephen Philbin
08-28-2007, 09:23 AM
Thanks for the info, Charles. I was hoping you'd find this thread because I knew you'd mentioned you'd occasionally done this in the past, but I thought you'd perhaps stopped visiting.