Jul 23

Hello,

As you should know multiple data export formats are an absolute requirement to web applications these days.

Recently i got through working on a proposal creation and management application with theme support.
So i couldn’t bare to use a simple customized pdf export system using FPDF or something alike – i needed a really good HTML to PDF converter.
Well, i’ve spent a couple of days looking for the best answer to this question.

I’ve tested 4 different HTML to PDF classes/libraries out there, and read about a few more throughout the web.

Dompdf, which i had used before on previous projects was my first choice, the code is kind of nicely done and well organized into classes. I had to edit the filenames but it ended up playing well with NaturePhp. It worked more or less in the beginning but after de first application release some strange rendering and memory problems. The application would just die if i the user added some custom texts sometimes (without any errors displayed…) and text alignment and tables didn’t work very well…

So i went back to looking for another solution – the first i tested was TCPDF – it worked actually much better than dompdf, but the lack of much CSS support didn’t work for my purposes – still it looked like really stable and had some nice extra features.
I´ve also tried html2fpdf but it didn’t really work as i expected.

After much looking around i finally found html2ps. The site looks a bit old and ugly but i had already read some nice quotes about it somewhere so i decided to take a look.
Meaningless to say html2ps ’saved’ my weekend – it works really good. Well it’s not perfect, but as long as keep your html more or less simple and well formed, it renders nearly perfection.
Stable, reliable and so far the best option i’ve tested for HTML to PDF conversion for php.

However, the API code and online documentation could be better – it took me a while to integrate it into NaturePhp and get it to work. It really is much simpler if you use it via a simple HTTP request (with options via querystring) as the ‘demo’ folder shows.

I know it is not easy – I myself am struggling to get some decent NaturePhp documentation out – but such a nicely working project should really be given a nicer look to the site/docs and possibly some major code review.

Visit them at tufat.com or freashmeat

Still, from now on, it will be my PDF converter of choice, unless something better comes around…

[del.icio.us] [Digg] [Facebook] [Twitter]
May 7
Oct 24
Sep 13
Aug 13

« Previous Entries