Stack: Craft CMS PHP mPDF Twig Composer GitHub
Craft CMS projects often need documents generated from content stored in the control panel: catalogs, product sheets, reports, invoices or downloadable materials. Preparing every file manually becomes inconvenient, while adding an external SaaS platform is not always justified.
I developed PDF Generator, a plugin that connects Craft CMS with the mPDF library. A document can be rendered from a Twig template, an HTML block or an external URL.
The plugin provides two main methods:
pdf(): generates a document and returns a URL for download or inline browser preview,pdfAsset(): stores the generated file as a Craft CMS asset, making it possible to use volumes, caching and the standard asset workflow.The extension is useful when documents should be generated from content managed in the CMS. It can handle a single downloadable file or become part of a larger publishing workflow. Active installs on 09.06.2024 are 222.
The plugin supports Craft CMS 3, 4 and 5. The code is publicly available on GitHub and in the Craft Plugin Store. It can be installed with Composer:
composer require cooltronicpl/document-helpers








Do you need PDF generation in Craft CMS? Tell me briefly how the documents should be used.