Sometimes you just want to Print only content in Div with your custom id
This module uses https://printjs.crabbly.com/ library for this purpose.
you can specify the id you want to print in configuration, by default id="print"
<div id="print"> Print me</div>

How to use:

  • It's easy to print specific parts of a page by wrapping content in a div with a custom ID, e.g. <div id="print">...</div>. The ID can be configured in the module settings.
  • Place Printjs block, it will show print button Print, when you click will send content in id=print + css of page to printer.
  • You can add print buttons to trigger printing in views headers/footers.
  • The module is highly extensible via hooks like hook_preprocess_printjs. For example, you can customize the print output to generate PDFs, images,json etc. instead of plain HTML more infomation in https://printjs.crabbly.com/.

In summary, PrintJs is a developer-friendly module that offers easy and configurable printing of Drupal content. By using div IDs, you can selectively print just what you need, not print all page with header / footer/ sidebar

Do you like this module? Show your appreciation by buying me ☕.

Supporting organizations: 

Project information

Releases