From 54d4741f323c67ec5f1fdcce9144a051d48be509 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Wed, 15 Apr 2026 13:47:12 +0000 Subject: [PATCH 1/2] Initial plan From b310658ed91f77633907c41bd7938f8c764cdb34 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Wed, 15 Apr 2026 13:52:26 +0000 Subject: [PATCH 2/2] Document Dompdf PDFLib performance option Agent-Logs-Url: https://github.com/endroid/pdf/sessions/cffe3ad7-81bb-4bf9-b605-eabddc0e9f55 Co-authored-by: endroid <537253+endroid@users.noreply.github.com> --- README.md | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 5f9222e..9f93dbe 100644 --- a/README.md +++ b/README.md @@ -7,7 +7,7 @@ [![Total Downloads](http://img.shields.io/packagist/dt/endroid/pdf.svg)](https://packagist.org/packages/endroid/pdf) [![License](http://img.shields.io/packagist/l/endroid/pdf.svg)](https://packagist.org/packages/endroid/pdf) -Library for easy PDF generation built around wkhtmltopdf and Snappy. Click +Library for easy PDF generation built around Dompdf. Click [here](https://endroid.nl/play/pdf) for an example. Please note this example takes some time to load because it contains a lot of pages and no caching is applied. @@ -66,6 +66,24 @@ embed resources like fonts, stylesheets and scripts. For more information you can [read the documentation](https://github.com/endroid/embed). +## Dompdf performance + +By default Dompdf uses the `CPDF` backend. For large or complex documents, Dompdf can be faster when using +the PDFLib backend. + +`endroid/pdf` forwards all Dompdf options via `setOptions()`, so you can enable PDFLib like this: + +```php +$pdfBuilder->setOptions([ + 'pdfBackend' => 'PDFLib', + // Optional: set when your PDFLib installation requires it + // 'pdflibLicense' => 'your-license-key', +]); +``` + +The PDFLib backend requires the `pdflib` PHP extension. The extension is distributed via PECL: +https://pecl.php.net/package/pdflib + ## The PDF builder When [endroid/installer](https://github.com/endroid/installer) detects Symfony