Choosing the right PDF library in PHP
From the blog:
There are a number of PDF libraries that can help you dynamically generate .PDF files through PHP : FPDF, TCPDF, DOMPDF, CEZPDF…
I’ve long worked with FPDF which is very light (with a core file of 49ko), easy to implement but the functions provided are limited.
TCPDF first astonished me since it is able to display pure HTML in a pdf file (tables, css,… support). It also provides transformation functions that allow you to display text vertically on a .pdf file, for example. But the TCPDF core file is much too heavy : 963 ko. I run AJAX scripts that load that library at each AJAX call, which makes the time waiting for the .pdf files to be ready much too long. So, I’ve tried to make that class lighter and got rid of all comments it contained. But I still had more than 500ko of file.
I then decided to go back to FPDF and found an extension class that allows FPDF to rotate text on a page.
This tutorial is devoted to implementing FPDF (and rotation class) in PHP framework Codeigniter 2.0.3.