Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
By adixon on
I've just discovered a great html2pdf converter here:
http://www.rustyparts.com/pdf.php
Previously, I've used the pdfview module, which makes use of the html2fpdf code, and it produces some really ugly pdfs because it doesn't pay attention to css. The one above requires perl, html2ps, and another library, so it's not so fun to install, and the rendering is a little slower but the results are truly impressive.
I won't volunteer to write a new module (i actually implemented it in the theme), but if anyone else cares, you can bug me and I'll provide more details.
Comments
interesting
thanks for posting that.
it looks very interesting. Much more drupal friendly than the pdfview.module which is great, but, very difficult to theme the output at the moment.
Do you have any more details? Care to share your theme code you used to integrate it?
Phil
theme snippet
i implemented it kind of like the print-friendly mechanism (in the old civicspace theme). In other words, i generate the usual output from page.tpl.php, with some modifications, and then at the bottom of the page.tpl.php, i have the following code, which grabs the html output, processes it through the html2ps code and then outputs it. The normal page has a little link on it which just appends ?pdfview=1 to the current url to trigger the pdf output. This approach means any page can be pdf'd.