[ale] HTML -> PS -> PDF

J.M. Taylor jtaylor at onlinea.com
Wed Mar 31 16:01:54 EST 2004


I don't know if this will work with J2EE, or if you can do system calls, 
or if you're on linux...but...htmldoc (http://www.easysw.com/htmldoc/) 
makes nice pdfs from html.  AFAIK, you'd just write out the HTML, then do 
a system call (ick ick...be sure it's secure) to htmldoc which ought to 
spit out a pdf in the same directory.

To deliver it, use the right content types 
header('Content-Type: application/pdf; name="report.pdf"');  
header('Content-Disposition: attachment; filename="report.pdf"');
(where header() is however j2ee presents headers to the browser)
and output the pdf. 

Good luck.

jenn

On 31 Mar 2004, 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?
> 
> _______________________________________________
> Ale mailing list
> Ale at ale.org
> http://www.ale.org/mailman/listinfo/ale
> 
> 

-- 
Jenn Taylor
jtaylor at onlinea.com

------------------------------------------------------------------------
Obviously, a man's judgement cannot be better than the information on which he
has based it.  Give him the truth and he may still go wrong when he has
the chance to be right, but give him no news or present him only with distorted
and incomplete data, with ignorant, sloppy or biased reporting, with propaganda
and deliberate falsehoods, and you destroy his whole reasoning processes, and
make him something less than a man.
-- Arthur Hays Sulzberger




More information about the Ale mailing list