Choosing the right PDF library in PHP

From the blog:

Choosing the right PDF library in PHP

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.

Advertisements

~ by WPA Staff on September 21, 2012.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

 
%d bloggers like this: