use MPDF
mPDF is a PHP class that generates PDF files from UTF-8 encoded HTML code. It is based on FPDF and HTML2FPDF , with a number of improvements.
I wrote mPDF to output PDF files on the fly from my site, processing different languages. This is slower than the source scripts, for example. HTML2FPDF also creates large files when using Unicode fonts, but support for CSS styles, etc. Significantly improved - see features .
Please view examples and feel free to download it. There is a fairly extensive online reference guide for mPDF.
Here is a list of arguments that you can pass to the default constructor.
$mpdf = new mPDF('', // mode - default '' '', // format - A4, for example, default '' 0, // font size - default 0 '', // default font family 15, // margin_left 15, // margin right 16, // margin top 16, // margin bottom 9, // margin header 9, // margin footer 'L'); // L - landscape, P - portrait
source share