in reply to HTML and SVG to PDF
I can't use any external application, (html2ps or something like that) because the pdf has to be the output of my program.
Are temporary files permitted? If so, you can use an external app, then read the generated file back in and send it to STDOUT.
Also, a quick glance at PDF::FromHTML suggests that it uses PDF::Template for its generation of the PDF, so you should be able to modify the example to:
my $pdf = PDF::FromHTML->new( encoding => 'utf-8' ); $pdf->load_file('source.html'); $pdf->convert( Font => '/path/to/font.ttf', LineHeight => 10, Landscape => 1, ); print "Content/type: application/pdf\n\n", $pdf->pdf->get_buffer;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: HTML and SVG to PDF
by josera (Beadle) on Aug 12, 2005 at 08:01 UTC |