Dompdf

screenshot of Dompdf

HTML to PDF converter for PHP

Overview:

Dompdf is an HTML to PDF converter written in PHP that is CSS 2.1 compliant. It is a style-driven renderer that can handle external stylesheets, inline styles, and presentational HTML attributes. It is capable of rendering complex tables, supporting various image formats, and does not require external PDF libraries.

Features:

  • CSS Support: Handles most CSS 2.1 and a few CSS3 properties like @import, @media, and @page rules.
  • HTML Attributes: Supports presentational HTML 4.0 attributes.
  • External Stylesheets: Supports external stylesheets through local files or http/ftp.
  • Table Support: Capable of rendering complex tables with row & column spans and individual cell styling.
  • Image Support: Supports various image formats like gif, png, bmp, and jpeg.
  • No Dependencies: Does not rely on external PDF libraries.
  • Font & Character Encoding: Supports fonts like Helvetica, Times-Roman, Courier, Zapf-Dingbats, and Symbol internally.

Install with Composer:

composer require dompdf/dompdf

Download and Install:

  1. Download a packaged archive of dompdf.