Question Locked

HTML TO PDF WITH PERL

0 helpful
3 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.
I want to use a simple html form and when the user submits form it will take the data and put it in a pdf form and send it out in a email. I am not sure how to do this but i would like to do it with perl if possible.

3 replies

by toivo talikka

There is a GPL licensed Perl program called denature which converts HTML documents to PDF: http://sourceforge.net/projects/denature "It does this through a transformation to XSL-FO which is then passed to the FOP program, from xml.apache.org."

There is also a commercial program HTMLdoc, described in detail in this article on a hard-to-read background http://www.suite101.com/article.cfm/perl/108695 You can purchase the module from the same site and use it from Perl.

If you need to render PDF files for viewing and printing, rather than converting from HTML, you should take a good look at the FPDF class in PHP, available free of charge. I have used it to render a fairly complex invoice layout. There is much less work in producing printable WYSIWYG output than fiddling with CSS and XHTML. Download from http://www.fpdf.org

The FPDF class has also been ported to Ruby: http://zeropluszero.com/software/fpdf

If you have PHP available in your server, you may be able to call a PHP module from within Perl, using the PHP Command Line Interface (CLI) as the intermediary. A bit clumsy but it might work.

This discussion is closed to new replies.