Drupal is a registered trademark of Dries Buytaert
drupal 11.3.7 Update released for Drupal core (11.3.7)! drupal 11.2.11 Update released for Drupal core (11.2.11)! drupal 10.6.7 Update released for Drupal core (10.6.7)! drupal 10.5.9 Update released for Drupal core (10.5.9)! cms 2.1.1 Update released for Drupal core (2.1.1)! drupal 11.3.6 Update released for Drupal core (11.3.6)! drupal 10.6.6 Update released for Drupal core (10.6.6)! cms 2.1.0 Update released for Drupal core (2.1.0)! bootstrap 8.x-3.40 Minor update available for theme bootstrap (8.x-3.40). menu_link_attributes 8.x-1.7 Minor update available for module menu_link_attributes (8.x-1.7). eca 3.1.1 Minor update available for module eca (3.1.1). layout_paragraphs 2.1.3 Minor update available for module layout_paragraphs (2.1.3). ai 1.3.3 Minor update available for module ai (1.3.3). ai 1.2.14 Minor update available for module ai (1.2.14). node_revision_delete 2.0.3 Minor update available for module node_revision_delete (2.0.3). moderated_content_bulk_publish 2.0.52 Minor update available for module moderated_content_bulk_publish (2.0.52). klaro 3.0.10 Minor update available for module klaro (3.0.10). klaro 3.0.9 Minor update available for module klaro (3.0.9). layout_paragraphs 2.1.2 Minor update available for module layout_paragraphs (2.1.2). geofield_map 11.1.8 Minor update available for module geofield_map (11.1.8).

entity_print_css_injector

2 sites No security coverage
View on drupal.org

Entity Print CSS Injector is a Drupal module that improves the PDF output generated by Entity Print by automatically embedding CSS styles from the Asset Injector or from a static folder.
This ensures that all PDF documents maintain a consistent and professional layout without requiring theme-specific preprocessing hooks. The module is designed to work seamlessly with wkhtmltopdf and provides reliable formatting across all themes used on the site.

Features

The module automatically detects and includes CSS from the Asset Injector (prefixed by epcss_) AND from files located in web/sites/default/files/static/entity_print_css/.

It works independently of the active theme, requires no manual modifications to theme files, and embeds the CSS inline to avoid path issues during PDF rendering.
It is fully compatible with Entity Print and the wkhtmltopdf renderer.

Post-Installation

After enabling the module, on Debian-based systems, install wkhtmltopdf using the command sudo apt install wkhtmltopdf.

In the Entity Print configuration, select the “Php Wkhtmltopdf” renderer and provide the path to the wkhtmltopdf executable.
Set the DPI to 300 to ensure high-resolution output.

Step by step:

  1. On Debian-based systems, install wkhtmltopdf: sudo apt install wkhtmltopdf
  2. In the Entity Print configuration, specify the path to wkhtmltopdf after selecting the “Php Wkhtmltopdf” renderer
  3. Set the DPI to 300 to ensure crisp and high-resolution PDF output
  4. Optionally, place a css/pdf.css file in the active theme if the Asset Injector is not used

Additional Requirements

The Asset Injector is not directly a requirement, but a good hint to change the style at runtime.
The asset injector files need to have a prefixed machine name epcss_.

The pdf generator only supports plain CSS.
Preprocessor languages such as Sass, Less, or other CSS compilation features are not supported and will not be applied in the PDF output.

Activity

Total releases
1
First release
Oct 2025
Latest release
5 months ago
Release cadence
Stability
100% stable

Releases

Version Type Release date
1.0.0 Stable Oct 19, 2025