Link to home
Start Free TrialLog in
Avatar of c1174268
c1174268

asked on

Best PDF Library to use with PHP

Hi,

We have developed a custom built web based system using PHP for a client who provides HIP Packs. The system currently manages everything from on-line orders, payments, invoicing, Account Customers, Statement of accounts etc.

The next step is to automatically create certain documents based on th einformation provided. These documents ideally need to be as PDF. Each Document will have a number of design variations depending on which client its for i.e resellers.

We can do all this in PHP and output to HTML pages No Problem. However, I am not sure which PDF Library to use. The system has about 10 users and they work on it for approx 8-10 hours per day. Each user processes various different aspects of the order. They are inputting about 50-60 orders per day.

So i need a PDF Library that:

Ideally is cheap or open source.
Is not Too slow
Needs to output correctly - The design/ layout of each PDF has to be perfect
ideally something that is easy to implement on a shared hosting server (Using 1 and 1)

I don't mind if it can be done via a cron, so that it runs at midnight for example to not affect the speed of the system.

Also, i don't mind if we out put to HTML first then it converts to PDF, but we need to ensure layout, page breaks etc work correct.

Appreciate your help

Thanks
Avatar of Pramod Bugudai
Pramod Bugudai
Flag of India image

Try this,
http://www.fpdf.org/

I have used this class and generated lot of pdf's
Hi,

Tcpdf is multi-language supported.

You can create pdf files easily with tcpdf class.
Avatar of c1174268
c1174268

ASKER

Hi Guys,

Thanks for your thoughts so far?

what are the pro's and cons of using each. i want know how people have found using them, not just a feature list. what are your personal favourites and why
Hi,

Due to multilanguage support I am using TCPDF class.
just so everyone is aware, i do not need multi language support.
Why I am using them because those are flexible and easy to use.
So far it seems the choices for me are down to FPDF or TCPDF. Is there any major difference between the two and which one is easier to use and outputs faster?
FPDF is easy and I tried, it looks good
Also any thoughts on DOMPDF compared to the other two?
From my limited research, although TCPDF is newer and has more features, it seems the PDF files are much larger in size compared to FPDF. Does anyone have experience of using both programs?
FPDF is the gold standard.  You can position to within 1/100 inch (good enough for detailed resolution on things as small as business cards).  It supports the addition of fonts, images and drawing objects.  It is all OOP code and easy to extend.  The online documentation is very concise and accurate.

I do not recommend creating a document in HTML and then trying to go to PDF.  Instead create a data set, perhaps as an object or array.  Use an abstraction layer to send the data set to any of the various output formats.  This helps keep the business logic separated from the presentation logic.

Best of luck, ~Ray
Hi Ray

Thanks for Posting? Have you used TCPDF? my only worry with FPDF is that it has'nt been updated in a while, should I be concerned about this? Also does FPDF require PHP5?
ASKER CERTIFIED SOLUTION
Avatar of Ray Paseur
Ray Paseur
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial