A PDF inquiry summary can help a team review a Contact Form 7 lead outside WordPress, provided the document has a clear purpose and an appropriate access policy. Creating that PDF is a separate processing step: CF7 does not turn every submission into a secure downloadable document simply because a rendering library is installed.

Dompdf, mPDF, tc-lib-pdf, WeasyPrint and Playwright offer different rendering and runtime models. This comparison uses official documentation and upstream licenses checked October 31, 2026, without claiming firsthand speed or fidelity tests. We operate CF7 Analytics; these are independent components for a custom workflow, not verified native integrations in our plugin.
Define the document and delivery boundary
Start with a short specification: intended reader, permitted fields, page size, maximum message length, languages, retention and access. Feed a renderer a deliberately prepared document model. Keep visitor answers as escaped text within a trusted template, rather than treating them as arbitrary HTML, CSS or a URL to fetch.
Also decide what happens after generation. Saving a PDF, attaching it to an authorized notification and making it available through an authenticated application are different operations. Our static attachment guide concerns existing files; dynamic per-inquiry generation needs its own reviewed implementation and lifecycle.
| Component | Runtime approach | Useful fit | Main limitation |
|---|---|---|---|
| Dompdf | PHP HTML/CSS renderer | Simple PHP-owned summaries | Restricted CSS and table pagination |
| mPDF | PHP UTF-8 HTML renderer | Document-oriented layouts and languages | Renderer-specific markup and resources |
| tc-lib-pdf | Modular PHP PDF library | Programmatic document composition | Migration and setup differ from TCPDF |
| WeasyPrint | Python paged HTML/CSS engine | Print-focused documents in a worker | Separate runtime and native dependencies |
| Playwright | Headless Chromium PDF path | Browser-rendered HTML documents | Browser operation and print readiness |
Dompdf
Dompdf converts HTML to PDF in PHP, with broad CSS 2.1 support and selected later features. For a WordPress-adjacent adapter, that can keep a simple inquiry document within an existing PHP dependency workflow. Use a dedicated document template rather than assuming the live site design will print identically.
Strengths: a straightforward HTML source suits labeled answers, a compact heading and a small summary table. The project documents restrictions on local files through its configured root and on remote assets through explicit options. Keep approved fonts and artwork local when that makes the document easier to reproduce.
Limitations: its documented layout constraints include unsupported flexbox and Grid, and table cells cannot split freely across pages. A long inquiry message inside one table row therefore deserves particular attention. The project also advises against reusing one renderer instance across multiple documents. Its core uses LGPL-2.1 terms with no core license fee. Choose Dompdf for deliberately simple PHP-owned layouts, then review long-answer pagination and the exact version’s asset policy.
mPDF
mPDF generates PDFs from UTF-8 HTML in PHP and documents features for headers, footers, page numbering, fonts and multiple writing systems. An inquiry summary with recurring document furniture may fit that document-oriented model better than a printout of a public web page.
Strengths: the manual provides specific guidance for pagination, language handling and document structures. A maintainer can build a purpose-made template with a stable header and readable field sections. Keep language and font fixtures representative of the inquiries the business actually receives.
Limitations: the documented limitations matter when adapting modern website markup. Verify supported CSS instead of assuming a browser preview is authoritative. Temporary files, fonts and memory also need a deliberate operational configuration. Current package metadata identifies GPL-2.0-only licensing, with no core software license charge. Choose mPDF when its document features fit the requirement and the distribution model has been reviewed against the selected license and dependencies.
tc-lib-pdf
tc-lib-pdf is the current modular PHP project identified by the older TCPDF repository as its successor. This is a meaningful selection detail: the legacy TCPDF project is marked deprecated, and the successor explicitly says it is not a drop-in replacement.
Strengths: its documented services and features support programmatic control of document pages, fonts, graphics and related content. For a carefully specified inquiry document, a developer can keep composition rules in reviewed code instead of relying only on a copied website stylesheet. The project also documents HTML/CSS rendering capabilities.
Limitations: the modular Composer setup, strongly typed API and asset preparation require implementation work. Existing TCPDF examples cannot be assumed to run unchanged. Verify the installed package requirements and use examples for the selected version. The core is LGPL-3.0-or-later and has no core license fee. Choose it for a PHP team that wants explicit document composition and can own the integration, rather than treating it as a quick rename of an old TCPDF dependency.
WeasyPrint
WeasyPrint is a Python HTML/CSS rendering engine designed around pagination and printing. It is not a full browser engine. A separate document worker can receive a prepared inquiry model, render a trusted template and return a controlled artifact to the application.
Strengths: a print-focused layout model can suit multi-page summaries, predictable margins and recurring document content. Keeping rendering in a worker can also make its runtime and resource budget explicit. That architectural separation is a design choice, not evidence that a particular queue or CF7 connector already supports it.
Limitations: installation includes Python and native dependencies such as Pango. The security guidance discusses risks from untrusted HTML/CSS and resource access. Use a controlled template, bounded inputs and an approved fetch policy. Do not expect browser JavaScript to assemble the document. WeasyPrint uses BSD-3-Clause licensing with no core software fee. Choose it when a Python document worker is maintainable and print layout requirements justify that additional service boundary.
Playwright
Playwright’s page.pdf() provides a Chromium-based route from a rendered page to PDF. It uses print media styling by default. This can be useful when the document source already depends on browser layout, but it should render a dedicated, controlled document page rather than a live public form with unrelated scripts.
Strengths: a team can use familiar HTML and print CSS, with an explicit readiness condition for fonts, images and application-generated content. A carefully prepared document route can share approved visual components with other internal views. Keep the data supplied to that route small and purpose-specific.
Limitations: operating a browser process adds installation, lifecycle and resource considerations. A successful page navigation does not prove the PDF is ready; review page breaks, margins and loaded assets. The PDF path should not be assumed to have identical support across Firefox and WebKit. Playwright’s core is Apache-2.0 licensed with no core fee; browser components and hosted services have their own terms. Choose it when browser rendering is necessary and the team can maintain a bounded rendering worker.
Compare the same document before selecting
Use fictional inquiries with short and very long messages, accented names, a missing optional answer and a multi-selection list. Include a document long enough to cross a page boundary. Review the complete PDF visually and extract its text to verify that no answer disappeared through clipping or pagination.
Check fonts, selectable text, link destinations, metadata and the actual access mechanism. Do not call a document accessible or archival-compliant solely because a renderer exposes an option with that name. Keep personal answers out of public upload directories and external preview services unless that delivery is specifically designed and authorized.
Choose by layout and operational ownership
Choose Dompdf for simple PHP HTML, mPDF for its document-oriented PHP features, tc-lib-pdf for explicit PHP composition, WeasyPrint for a Python print workflow, or Playwright for browser-dependent rendering. Count maintenance and processing cost alongside the absence of a core license fee. Generation, delivery and recipient access each need separate acceptance evidence.
Our free Svetlik Analytics for Contact Form 7 plugin supports submission statistics. It does not generate these PDFs or prove successful delivery. Keep the form acceptance checks and document fixtures together in your maintenance process.
License and package sources
Review the exact selected version and dependencies: Dompdf license, mPDF package license metadata, tc-lib-pdf license, WeasyPrint license and Playwright license. Fonts and bundled assets can have separate notices.
