dompdf is an HTML to PDF converter. At its heart, dompdf is (mostly) a CSS 2.1 compliant HTML layout and rendering engine written in PHP. It is a style-driven renderer: it will download and read external stylesheets, inline style tags, and the style attributes of individual HTML elements. It also supports most presentational HTML attributes.
PDF rendering is currently provided either by PDFLib or by a bundled version the R&OS CPDF class written by Wayne Munro. (Some important changes have been made to the R&OS class, however). In order to use PDFLib with dompdf, the PDFLib PECL extension is required. Using PDFLib improves performance and reduces the memory requirements of dompdf somewhat, while the R&OS CPDF class, though slightly slower, eliminates any dependencies on external PDF libraries.
Note that some required dependencies may have further dependencies (notably php-svg-lib requires sabberworm/php-css-parser).
Visit the wiki for more information: https://github.com/dompdf/dompdf/wiki/Requirements
$dompdf->set_option('isHtml5ParserEnabled', true);) or run your HTML through a HTML validator/cleaner (such as Tidy or the W3C Markup Validation Service).