Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 19 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand Down Expand Up @@ -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
Expand Down