Skip to main content
Drupal is a registered trademark of Dries Buytaert
Release: OpenID Connect / OAuth client 3.0.0-alpha9 New alpha version released for module openid_connect (3.0.0-alpha9). Usage Milestone: Google Analytics Module google_analytics crossed 1,000 active installs. Release: GraphQL Compose Codegen 1.1.2 Minor update available for module graphql_compose_codegen (1.1.2). Release: Mapy.com 1.1.3 Minor update available for module mapycom (1.1.3). Release: Ckeditor5 entity browser 3.0.3 Minor update available for module ckeditor5_entity_browser (3.0.3). Release: Ckeditor5 entity browser 3.0.1 Minor update available for module ckeditor5_entity_browser (3.0.1). Release: Ckeditor5 entity browser 3.0.2 Minor update available for module ckeditor5_entity_browser (3.0.2). Release: Teamleader Integration 4.0.2 Minor update available for module teamleader (4.0.2). Release: Change Requests 2.1.9 Minor update available for module change_requests (2.1.9). Module Revived: Entityqueue Buttons 1.1.2 Module entityqueue_buttons updated after 8 months of inactivity (1.1.2).

Entity Print CSS Injector

5 sites No security coverage Drupal 10 · not 11 Entity ecosystem
View on drupal.org

This module enhances PDF generation in Drupal by automatically embedding CSS styles. It ensures consistent and professional PDF layouts by injecting styles from either your Asset Injector or a designated static folder, without needing theme modifications. The module works with common PDF rendering tools and guarantees reliable formatting across your site's themes.

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.

Depends on

Dependencies of the latest stable release

  • entity_print Drupal core

Required by

Tracked projects that depend on this one

No tracked projects depend on this one yet.

Activity

Tracked releases
1
Tracked since
Oct 2025
Latest release
10 months ago
Releases (12 mo)
1 ▲ from 0
Maintenance
Slowing

Releases

Version Type Core Release date
1.0.0 Stable 10 Oct 19, 2025