[ale] HTML -> PS -> PDF

Michael D. Hirsch mhirsch at nubridges.com
Thu Apr 1 09:48:37 EST 2004


On Wednesday 31 March 2004 03:47 pm, Chris Fowler wrote:
> I'm creating a J2EE app in which the user can generate reports.  I want
> to generate a report in HTML format and store in /tmp as temp file.  I
> then want to somehow convert that to PDF maybe I have to go the PS
> first.
>
> After I do that I will send their browser headers that indicate I'm
> sending them a file.  The will then be prompted to save to disk or load
> in Acrobat or in our (ale.org) case xpdf.
>
> Any pointers?

I think you'd have a lot more success generating XML instead of HTML.  Then 
you can convert the XML to HTML easily (e.g. with XSLT).  A quick google 
search will turn up any number of XML->PDF systems.  A good one loks like FOP 
from the Apache Project: http://xml.apache.org/fop/

It says: FOP (Formatting Objects Processor) is the world's first print 
formatter driven by XSL formatting objects (XSL-FO) and the world's first 
output independent formatter. It is a Java application that reads a 
formatting object (FO) tree and renders the resulting pages to a specified 
output. Output formats currently supported include PDF, PCL, PS, SVG, XML 
(area tree representation), Print, AWT, MIF and TXT. The primary output 
target is PDF. 

Michael



More information about the Ale mailing list