HTML To PDF Rendering Engine: dompdf

dompdf is a HTML to PDF conversion / rendering engine written in PHP 5.

It downloads and reads external stylesheets, inline style tags, and the style attributes of individual HTML elements. It also supports most presentational HTML attributes.


It enables rendering via PDFlib or R&OS CPDF class which can be selected.

Some features of dompdf:

  • handles most CSS2.1 properties & selectors, including @import, @media & @page rules
  • supports most presentational HTML 4.0 attributes
  • supports external stylesheets, either on the local machine or through http/ftp (via fopen-wrappers)
  • supports complex tables, including row & column spans, separate & collapsed border models, individual cell styling, multi-page tables (no nested tables yet however)
  • image support (png, gif & jpeg)
  • link and anchor support
  • inline PHP support.

P.S. A security vulnerability exists with dompdf but also the solution can be foundfor it at the product page.