skip to content

 Web design 

Database-driven systems

Easy-to-maintain web sites



HTML2PDF allows you to take existing html output (with some limitations) and create a PDF file. If you are working in PHP, then the html that is used to create a screen display can be used to create a PDF file.

Using it is as simple as:

$pdf=new HTML2FPDF();

What works

  • Text using local font definitions or styles
  • Tables
  • JPG and PNG graphics


  • It doesn't seem to accept linking a "style" module so you have to put styles in-line.
  • Tables are generated using a single font and size. Borders are limited to on and off.
  • Gif images don't work (fatal error in generation). bmp and tif not supported. 

See the FAQ on the HTML2PDF website for more on limitations.

Extra Features

  • The <newpage> command can be inserted to force a skip to a new page.
  • Pages are numbered.
  • A PDF bookmark page title can be added.

More Notes

I captured some observations when I was testing this system. See the notes here


  • I haven't changed the system itself. I have added some notes on using it and some extra examples.
  • The system was actually written in two parts. The underlying system is called FPDF and the site can be found at:
  • HTML2PDF interprets the html and uses FPDF to create the PDF file. It can be found at:






Powered by Website Baker,
Design by Innovations Design based on a template by gavjof