BlogPhotosContact

Topics

Bye bye PDFLib

I have been using PDFLib for over 4 years now on various projects. Of course, I had to buy the PDFLib license because most are commercial projects and we needed the PDI feature which allows you for example to use another PDF document as a template. So I bought the PDFLib 5 license, then the PDFLib 6 license update because if I remember correctly PDFLib 5 didn't support unicode or something like that. That's about 1000 euros each time.

Recently, we have upgraded our hosting plan from our hosting company and instead of a single CPU on the server, we now have two for the same price. It's a nice upgrade. Unfortunately, PDFLib didn't like the upgrade and now returns the following error when we generate a document with our serial number "Found 2 CPUs - license covers only 1".

Of course, I have contacted their sales department about the problem. They replied that I should either buy another license for PDFLib 6 for the second CPU, or eventually buy PDFLib 7 which doesn't have this per CPU limitation. Both solutions cost approximately the same price, more than 900 euros !

I don't feel like buying another license and I don't need PDFLib 7 "features". So, farewell PDFLib ! It was nice working with PDFLib but they obviously became too greedy.

I am going to investigate other toolkits. I know that most of them do not support features like PDI, but I can probably find another way around this issue. So far, I have found :

  • Haru : There is a brand new PECL extension for Haru written by Antony Dovgal which was released last week in version 1.0. Sounds interesting !
  • FPDF : These are mostly PHP classes. The author claims that it is not as fast as PDFLib but says it performs well. I have already tried this solution before and it was working very well but I was only producing PDF invoices for an e-commerce site. Building a full catalogue might be too much for it. The nice thing is its companion class FPDI which can also import existing PDF files and worked for me the last time I tried.
  • TCPDF : In the same vein as FPDF, these are a set of PHP classes for generating PDF documents. I need to have a look at it as well. It seems to work with FPDI too.
  • Panda : There is also a PECL extension for Panda, but I am not sure it is maintained and the project didn't release anything for a long time.
  • Cairo : Cairo has a backend for PDF rendering. Given its strengths in graphics, this can be interesting but I think it will be too limited in my case as I need to create documents with multiple pages. There is also a PECL Extension for Cairo (there are two actually, but the other one didn't make a release yet).

I now have to evaluate them and rewrite some code for our new server. But in the end, I won't have to deal with PDFLib and its licensing mess anymore, so that's for the better.

Update : based on your comments, here are other interesting libraries to deal with PDF within PHP, http://www.ros.co.nz/pdf/ (not updated and not unicode aware it seems), ezPdf (looks too much integrated in an over-engineered framework. I couldn't even figure out where to download the class...), Zend_Pdf (well documented but I am not sure it supports features like PDI for importing a PDF), dompdf (an HTML to PDF converter, it is not what I need).
Comments (17)  Permalink

Comments

sputnik @ 21.11.2008 13:41 CEST
Looks like your are not the only one:

http://yro.slashdot.org/comments.pl?sid=230919=18743257 [http://yro.slashdot.org/comments.pl?sid=230919=18743257]

As another user suggests, "Never, ever, ever buy any software at all that licenses against a specific set of hardware." PDFLib wants you to beleive they are an open company, but they are not.
Thomas Koch @ 21.11.2008 13:59 CEST
Thought about a latex template and pdflatex?
Matthew Weier O'Phinney @ 21.11.2008 14:57 CEST
It may or may not meet your needs, but you might want to check out Zend_Pdf as well.
Sam Shull @ 21.11.2008 16:49 CEST
The Imagick PECL extension allows you to draw an image then save as PDF as well.
Bertrand @ 21.11.2008 17:28 CEST
Thank you for yours inputs, I will also investigate these tools.
riklaunim @ 21.11.2008 18:28 CEST
Reportlab in Python :)
Andi Gutmans @ 21.11.2008 18:55 CEST
If Zend_Pdf doesn't work out for you then please drop me a note and let me know what features you are missing which you'd absolutely need.
Goran Rakic @ 21.11.2008 19:43 CEST
I don't know what you are up to, but OpenOffice.org has nice headless mode. You can do PDF and much more.
pcdinh @ 22.11.2008 21:48 CEST
Zend_Pdf is immature at the moment. It even does not support table creation. I don't think it is worth a look.
Eirik Hoem @ 23.11.2008 00:28 CEST
Check out DOMPdf as well. I recently started using that.
Elizabeth Marie Smith @ 23.11.2008 01:04 CEST
Kick me hard enough and I'll get the new cairo extension's release out ;)
Danne @ 23.11.2008 15:16 CEST
As others have mentioned Zend_Pdf I also think you should have a look at it. I have built a system where we use it in production since four or five months. It is used to produce a multitude of different kinds of documents and letters that are automatically sent via integration towards mail handling companies.

As for tables it isn't really a problem. I implemented table support for our PDF template system in an hour and that's that. Works perfectly.
Peter Hopfgartner @ 23.11.2008 17:32 CEST
We are using Apache FOP since a couple of years. Runs fine, integrates well with SVG, but you have to run an external java job.
Wood @ 24.11.2008 02:04 CEST
I've been using ZendPDF in production: it's adequate, although it is a bit immature in some areas.

I've heard good things about TCPDF.

Please, post back any conclusions you come to :)
PHPUGPH.COM @ 24.11.2008 03:59 CEST
Been using this in all my projects for 2 years already...serves me very well.

http://www.ros.co.nz/pdf/ [http://www.ros.co.nz/pdf/]

Regards.
EllisGL @ 24.11.2008 15:27 CEST
I've used FPDF and EzPDF - both are nice. Have not tried TCPDF, which seems to be more updated. I'll have kick it's tires.
Damien @ 26.11.2008 11:53 CEST
eZPDF is part of the CMS eZ Publish, it is marked as deprecated.
Another way to create PDF, it is to generate an ODF file and then uses OpenOffice.org in daemon mode to convert this file in PDF.

Add a comment

The Trackback URL to this comment is:
http://golgote.freeflux.net/blog/plugin=trackback(118).xml

No new comments allowed (anymore) on this post.