-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Requirements
tooru edited this page Dec 17, 2024
·
14 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.
- GD is also required when background images are used since those go through additional processing to size the image.
- Additionally either the IMagick or GMagick PHP extension can be installed to improve image processing performance for certain images. These extensions do not replace GD but are used to complement specific functionality.
- 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.