You are here

README.txt in Printer and PDF versions for Drupal 8+ 8

Same filename and directory in other branches
  1. 2.x README.txt
CONTENTS
--------
 * INTRODUCTION
 * REQUIREMENTS
 * INSTALLATION
 * CONFIGURATION

INTRODUCTION
------------

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

    * Web page printer-friendly version (at /node/<nid>/printable/print)
    * PDF version (at /node/<nid>/printable/pdf)

where nid is the node id of content to render.

REQUIREMENTS
------------

 * This module is depends upon PDF Generator API (https://www.drupal.org/project/pdf_api)

INSTALLATION
------------

(This will simplify a lot once https://www.drupal.org/project/drupal/issues/2494073
is fixed).

- Download this module either using composer or by getting it directly from
  drupal.org:

  composer require drupal/printable

- Install this module's composer dependencies - they can be found in
  composer.json in the project directory. Run composer require for each
  dependency from the Drupal root:

  composer require "wa72/htmlpagedom": "1.3.*"
  composer require "smalot/pdfparser": "*"

- Enable printable:

  drush en -y printable

PDF GENERATION
--------------

- Download and install the pdf_api module. Check the contents of its
  composer.json and run composer require from the Drupal root for each
  library, as was done for this module above.

- Enable this module's PDF support, which will also now be able to enable
  pdf_api.

  drush en -y printable_pdf

- Install a library for generating PDFs (mPDF, TCPDF, wkhtmltopdf and dompdf
  are supported. Test status at 18 January 2018 is as follows (Ubuntu Xenial
  VM):
  - mPDF: Needs more testing.
  - TCPDF: Just works.
  - wkhtmltopdf: Fails with an error that print_api doesn't send back or
    display. I've opened an issue with print_api regarding suppling a patch
    or taking over maintaining the module.
  - dompdf: Needs more testing.

CONFIGURATION
-------------

- Configure your PDF library at /admin/config/user-interface/printable/pdf.
  For wkhtmltopdf, after you submit the form with wkthmltopdf selected, the
  form will gain an extra field allowing you to enter the path to the binary.
  Fill this field and submit again.

- Under /admin/config/user-interface/printable/linksi/pdf, click on the PDF
  second level tab and choose where PDF links should appear.

File

README.txt
View source
  1. CONTENTS
  2. --------
  3. * INTRODUCTION
  4. * REQUIREMENTS
  5. * INSTALLATION
  6. * CONFIGURATION
  7. INTRODUCTION
  8. ------------
  9. This module allows you to generate the following printer-friendly versions
  10. of any node:
  11. * Web page printer-friendly version (at /node//printable/print)
  12. * PDF version (at /node//printable/pdf)
  13. where nid is the node id of content to render.
  14. REQUIREMENTS
  15. ------------
  16. * This module is depends upon PDF Generator API (https://www.drupal.org/project/pdf_api)
  17. INSTALLATION
  18. ------------
  19. (This will simplify a lot once https://www.drupal.org/project/drupal/issues/2494073
  20. is fixed).
  21. - Download this module either using composer or by getting it directly from
  22. drupal.org:
  23. composer require drupal/printable
  24. - Install this module's composer dependencies - they can be found in
  25. composer.json in the project directory. Run composer require for each
  26. dependency from the Drupal root:
  27. composer require "wa72/htmlpagedom": "1.3.*"
  28. composer require "smalot/pdfparser": "*"
  29. - Enable printable:
  30. drush en -y printable
  31. PDF GENERATION
  32. --------------
  33. - Download and install the pdf_api module. Check the contents of its
  34. composer.json and run composer require from the Drupal root for each
  35. library, as was done for this module above.
  36. - Enable this module's PDF support, which will also now be able to enable
  37. pdf_api.
  38. drush en -y printable_pdf
  39. - Install a library for generating PDFs (mPDF, TCPDF, wkhtmltopdf and dompdf
  40. are supported. Test status at 18 January 2018 is as follows (Ubuntu Xenial
  41. VM):
  42. - mPDF: Needs more testing.
  43. - TCPDF: Just works.
  44. - wkhtmltopdf: Fails with an error that print_api doesn't send back or
  45. display. I've opened an issue with print_api regarding suppling a patch
  46. or taking over maintaining the module.
  47. - dompdf: Needs more testing.
  48. CONFIGURATION
  49. -------------
  50. - Configure your PDF library at /admin/config/user-interface/printable/pdf.
  51. For wkhtmltopdf, after you submit the form with wkthmltopdf selected, the
  52. form will gain an extra field allowing you to enter the path to the binary.
  53. Fill this field and submit again.
  54. - Under /admin/config/user-interface/printable/linksi/pdf, click on the PDF
  55. second level tab and choose where PDF links should appear.