PagePDF

Convert ProcessWire pages to PDF documents with advanced typography support

A ProcessWire module for generating PDF documents from pages with mPDF or Dompdf. It supports UTF-8/Cyrillic text, configurable typography, headers, footers, watermarks, password protection, and common ProcessWire field types including ProFields.

PagePdf

Version: 3.0.1
Author: Maxim Semenov
Website: smnv.org
Email: maxim@smnv.org

If this project helps your work, consider supporting future development: GitHub Sponsors or smnv.org/sponsor.

Formerly published as WirePDF. The module was renamed to PagePdf in 3.0.0 to avoid confusion and upgrade collisions with the legacy WirePDF class bundled in Pages2Pdf.

Features


  • Convert ProcessWire pages to PDF with $page->toPdf()
  • Render PDF output as a string with $page->renderPdf()
  • Save PDFs directly to disk with $modules->get('PagePdf')->savePdf()
  • Use mPDF by default, with Dompdf available as an optional engine
  • Configure paper size, orientation, margins, font, image DPI, headers, footers, and watermarks
  • Add PDF password protection and copy/print restrictions
  • Use the included Setup -> PagePdf Wizard admin page for guided setup
  • Generate PDFs from raw HTML, a custom template file, or full page rendering

Requirements


  • ProcessWire 3.0 or later
  • PHP 8.0 or later
  • Composer
  • mPDF library, installed with composer install

Quick Start


  1. Clone the module into /site/modules/PagePdf/.
  2. Run composer install inside the module directory.
  3. In ProcessWire admin, go to Modules -> Refresh.
  4. Install PagePdf.
  5. Open Setup -> PagePdf Wizard and create the generator template/page.
  6. Generate a PDF:
$page->toPdf([
    'filename' => 'document.pdf'
]);

Documentation


Basic Example


$page->toPdf([
    'filename' => 'report.pdf',
    'paper_size' => 'A4',
    'orientation' => 'landscape',
]);

License


MIT License - free to use in commercial and non-commercial projects.

Credits


More modules by Maxim Semenov

  • Context

    Export ProcessWire site context for AI development (JSON + TOON formats)
  • WireWall

    Advanced traffic firewall with VPN/Proxy/Tor detection, rate limiting, and JS challenge
  • Ichiban (SEO control center)

    Comprehensive SEO module: meta/OG/schema, audit, redirects, revisions, email reports.
  • Subscribe

    Newsletter subscription handler with lists, double opt-in, honeypot, rate limiting and unsubscribe link.
  • Dimensions

    Stores product dimensions (L×W×H) and weight with selectable units of measurement.
  • AiWire

    AI integration for ProcessWire. Supports Anthropic, OpenAI, Google, xAI, and OpenRouter.
  • Plausible Analytics

    Plausible Analytics dashboard using Stats API v2 with page-edit widget, traffic trends chart, and geo/device tabs.
  • PagePDF

    Convert ProcessWire pages to PDF documents with advanced typography support
  • Page Markdown

    Export any page to a clean Markdown file. Adds an export button to the page editor.

All modules by Maxim Semenov

Install and use modules at your own risk. Always have a site and database backup before installing new modules.