tags:

views:

308

answers:

2

Possible Duplicate:
How can I convert HTML to PDF using Perl?

Does anyone know best way to convert HTML to PDF using Perl? Is there any module available that can be used for this?

My HTML contains few images and charts which should be converted properly to PDF.

+1  A: 

"Convert HTML to PDF" presumes there is One Right Way to render HTML. There isn't. You have to consider dozens of variables (CSS vs none, Javascript vs none, width of the "virtual browser", etc).

Randal Schwartz
+1  A: 

My company wanted to do that once (in Perl), and it turned out to be painfully difficult (enough so that we stopped bothering). I believe the most realistic proposal was to embed a copy of a web browser somewhere and have it render the HTML and print it to a PDF driver. Of course, we wanted to preserve the formatting pretty exactly.

You might visit this CPAN search for 'html pdf' for some options, though. PDF::FromHTML might suffice for your needs.

fennec