Dom PDF

Dompdf is an HTML to PDF converter

PHP Library

HTML Layout

CSS 2.1

Requirements

  • PHP version 7.1 or higher
  • DOM extension
  • MBString extension (Alpine images beware)
  • php-font-lib
  • php-svg-lib

Fonts

Unicode support

  • DejaVu TrueType fonts

 

 

Windows ANSII encoding

  •  Helvetica, Times-Roman, Courier, Zapf-Dingbats, & Symbol

Drupal Integration

Entity Print

Project: https://www.drupal.org/project/entity_print

 

 

  • Entity Print allows you to print any Drupal entity (Drupal 7 and 8) or View (Drupal 8 only) to PDF.

  • You can swap the pdf engines
    • wkhtmltopdf
    • dompdf
    • tcpdfv1

Advantages

No dependencies on external PDF libraries

Comparisons

Wkhtmltodpf

Rich in features

CSS3

Needs wkhtmltopdf binary

Dompdf

Lightweight

CSS2.1

Unforgiving with faulty html markup

Tricky font support

Gotchas

Custom Fonts

  • Format - TTF 
  • UTF-8 Character encoding
  • Accessible to DomPDF (pre-installed at a known location)
    • Workaround can be to use webfonts.

Intolerance to faulty HTML

My Take

I would like to try some modern pdf solutions.

maybe am going to replace

known issue with unknown

Thank You!

Dom PDF

By shibin das

Dom PDF

  • 214