Skip to content
PaolaRuby edited this page Jul 15, 2022 · 13 revisions

Requirements

  • 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).

Optional Dependencies

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.

Optional Configuration

  • 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.

External libraries used by dompdf

  • 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)
  • Document parsing
  • SVG rendering

Note: These libraries are included in the packaged release download.

Clone this wiki locally