7

I am using Drupal 7.17, and have created content of type book. I want the users to be able to export it to PDF format. The pages contains images, HTML tables, HTML ordered and unordered list (ul and li). What is the best way to do this? The content styles should be preserved when exported.

  • 3
    Did you try Print module? – AjitS Dec 13 '12 at 11:14
  • 2
    Tell your users to install a PDF printer (like Primo PDF) or use Chrome which can already print to PDF...then just press print and it'll save as a pdf. Is there an angle to this question which makes it specifically related to Drupal and not to any website? – Clive Dec 13 '12 at 11:18
  • indrock- i'll try it. Clive - it would be nice to have this feature in the site itself, rather than asking the users to install softwares. – user12068 Dec 13 '12 at 11:20
  • 1
    @user12068 Fair point :) Be wary that server-side HTML -> PDF converters for PHP are notorious memory-hogs. Steer clear of anything that uses DOMPDF for complex layouts – Clive Dec 13 '12 at 11:24
  • 1
    It's also worth noting that most pdf generators have major issues with html tables that span over page breaks. – digital Dec 13 '12 at 11:30
6

You can use the Print module

This module allows you to generate the following printer-friendly versions of any node:

Printer-friendly version (webpage format) (at www.example.com/print/nid) PDF version (at www.example.com/printpdf/nid) Send by email (at www.example.com/printmail/nid) where nid is the node id of content to render.

And your choice of one of the 4 PDF libraries it supports. It does have very high memory requirements when generating PDF as previous comments have noted. It is well documented and the PDF output is fully themeable.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy