typdf
Typdf is a high-performance document engine for Drupal built on the Rust-based Typst open-source compiler. It offers a fast, memory-efficient way to generate complex, multi-page documents without putting heavy strain on your web server.
A Different Approach to PDF Generation
The Drupal community has long relied on excellent tools like Entity Print, Dompdf, and Wkhtmltopdf. We want to thank the developers of those projects for building the foundation that so many of us have used for years.
Typdf exists as an alternative for those who need a "markdown-first" workflow. Rather than converting heavy HTML and CSS—which can sometimes be unpredictable for print—Typdf uses a native typesetting system. This results in significantly faster generation times and lower RAM usage, making it a great fit for high-traffic or enterprise environments.
Drupal Coding Standards
- PHPCS - Passes
- PHPSTAN Level 8 - Passes
Key Features
- Performance: Documents compile in milliseconds using the Rust-based engine, preventing server timeouts during heavy loads.
- Editor Friendly: You don’t need to know Typst syntax. A built-in filter automatically translates standard CKEditor content (tables, lists, styles) into clean Typst markdown.
- Secure Media Handling: Securely fetches external images with SSRF protection and integrates directly with the Drupal Media Library.
- Workflow Integration: Includes support for Webforms, Views Bulk Operations (VBO), and ECA, allowing you to automate document generation across your site.
- Administration: Manage templates directly within the Drupal UI without needing to deploy physical files.
Efficiency and Caching
Typdf is designed for scale. By saving generated PDFs as static files, subsequent downloads bypass PHP entirely, serving documents in under 5ms. It also provides granular control over CDN headers (like Varnish or Cloudflare) and ensures private files remain secure with strict local caching rules.