Drupal is a registered trademark of Dries Buytaert
Protected Pages 3.0.0 Major update available for module protected_pages (3.0.0). Commerce Core 3.3.8 Minor update available for module commerce (3.3.8). Search API HTML Element Filter 1.0.7 Minor update available for module search_api_html_element_filter (1.0.7). Layout Builder Reorder 2.0.1 Minor update available for module layout_builder_reorder (2.0.1). Ban 1.1.0 Minor update available for module ban (1.1.0). Field Formatter Range 2.0.0 Major update available for module field_formatter_range (2.0.0). Field Formatter Range 8.x-1.8 Minor update available for module field_formatter_range (8.x-1.8). UI Patterns (SDC in Drupal UI) 2.0.18 Minor update available for module ui_patterns (2.0.18). Search API Solr 4.3.11 Module search_api_solr updated after 14 months of inactivity (4.3.11). Provus Mega Menu Module provus_mega_menu crossed 1,000 active installs.

PDF Forge

35 sites No security coverage Pdf ecosystem
View on drupal.org

PDF Forge allows you to export Drupal content directly to PDF using the pure PHP Dompdf library. It converts render arrays into styled PDFs, offering customization for headers, footers, page sizes, orientation, and pagination.

PDF Forge lets you export Drupal content to PDF with zero external binaries. It converts render arrays into polished PDFs using Dompdf, with optional headers/footers, page sizes, orientations, and pagination. New to Drupal? Enable the module, visit the demo page, and see your first PDF in seconds.

Features

  • Render arrays → PDF: Generate PDFs directly from Drupal render arrays (pure PHP via Dompdf).
  • Headers & footers: Inject custom HTML headers/footers with explicit height controls.
  • Page setup: Choose page size (A4, Letter, etc.) and orientation (portrait/landscape).
  • Styling: Add inline CSS and optional external CSS (with host allowlist).
  • Pagination: Automatic page numbers with configurable coordinates.
  • Demo hub: Built-in basic & advanced demos to sanity-check your setup.
  • Service API: Clean interface (PdfForgeInterface) for developers to integrate anywhere.

When to use: Invoices, receipts, order summaries, certificates, brochures, reports, or any printable view of site content.

Post-Installation

  1. Enable PDF Forge.
  2. Visit /admin/config/development/pdf-forge/demo to try the Basic and Advanced demos.
  3. Configure defaults at /admin/config/development/pdf-forge/settings (font, page size, orientation, remote asset allowlist).
  4. Developers: inject pdf_forge.forge (type-hint PdfForgeInterface) and call render($build, $options).

Tip: The advanced demo includes a header logo bundled in the module so it works out of the box.

Additional Requirements

  • Library: dompdf/dompdf (installed via Composer).
  • PHP: 8.1+ (recommended).
  • No external binaries (e.g., wkhtmltopdf) are required.
  • Composer for managing dompdf/dompdf and any CSS dependencies.
  • Devel (optional) to quickly build/test render arrays during development.

Similar projects

Other solutions include PDF/print modules that rely on different engines (e.g., wkhtmltopdf) or focus on printing node content. PDF Forge is distinguished by:

  • Pure-PHP Dompdf engine (simple hosting, no extra binaries).
  • Render-array centric API (works with any buildable structure, not just nodes).
  • Explicit header/footer sizing and pagination controls.
  • Built-in demo hub for instant validation.

Supporting this Module

If this module saves you time or budget, you can support development here:

Community Documentation

Basic documentation is available in the module’s README.md.

Activity

Total releases
2
First release
Aug 2025
Latest release
11 months ago
Releases (12 mo)
2 ▲ from 0
Maintenance
Slowing

Releases

Version Type Release date
2.0.0 Stable Aug 12, 2025
1.0.0 Stable Aug 11, 2025