PHP has several libraries for generating PDF documents. This
chapter shows how to use the popular FPDF library. The FPDF library is a
set of PHP code you include in your scripts with the
require function, so it doesn’t require any
server-side configuration or support, meaning you can use it even without
support from your host.
The basic concepts of the structure and features of a PDF file should be common to all the PDF libraries, however. This FPDF library is available here.
There is another PDF-generating library called TCPDF that is
better at handling HTML special characters and UTF-8 multilanguage
output. Look this up if you have that kind of a need. The methods you
will be spending time with will be
writeHTML. You can find the library here.