-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Requirements
PaolaRuby edited this page Jul 15, 2022
·
13 revisions
- PHP 7.1+ (required)
- DOM extension (required, enabled by default)
- MBString extension. MBString is required for Unicode support.
- read/write access to the directories specified by
\Dompdf\Options::$tempDir
,\Dompdf\Options::$fontDir
, and\Dompdf\Options::$fontCache
by the process running dompdf (typically your web server)
Note that some of the required dependencies may have further dependencies (notably php-svg-lib requires sabberworm/php-css-parser).
The following dependencies can add support for additional functionality or enhance existing functionality.
- GD extension: required for rendering image types other than JPEG. JPEG images can be placed into the rendered PDF as-is. Other image types require additional processing to support transparency and other features.
- IMagick or GMagick PHP extension: improves image processing performance, used in combination with the GD library.
- html5lib: a HTML5 parser that can detect and correct structural issues with a document
- OPcache (OPcache, XCache, APC, etc.): improves the overall performance of PHP code execution.
- allow_url_fopen set to true if you need to access "remote" files (that would be file references using a URL with protocol and domain, e.g. http://example.com/image.png); this is sometimes disabled by hosting providers.
- PDF Rendering
- CPDF (included with dompdf)
- PDFLib (optional alternative to CPDF, requires license)
- GD (optional alternative to CPDF)
- Font handling, if using fonts other than the core PDF fonts
(courier, helvetica, times)
- php-font-lib 0.5.x
- Document parsing
- SVG rendering
- php-svg-lib 0.3.x for SVG support
Note: These libraries are included in the packaged release download.