DerekAllard.com

DOMPDF moved to Google Code, New dev team

When I was building BambooInvoice, I wanted to have the ability to export invoices as PDFs. There are a number of excellent PHP based solutions for this, but Bamboo was unique in that it was a distributed application. I wouldn’t have control over the servers it was being installed onto. This meant I needed a PDF conversion library that didn’t rely on certain server libraries being present. I was also limited in that I wanted BambooInvoice to be released under an Open Source license.

I played with FPDF but found the syntax too onerous to be practical (I want users to be able to control the look of their PDFs, and with FPDF they’d essentially need to learn a new language).  So then I tried html2fpdf to create them on the fly from HTML pages.  I was disappointed with its lack of support for simple HTML.  I then found xhtml2pdf and html2ps... same thing.  Finally, I hit upon dompdf.  EXCELLENT!  Decent support for what I needed to do, and has decent (not great) support for many CSS styles and XHTML.

DOMPDF is an HTML to PDF converter. At its heart, dompdf is (mostly) CSS2.1 compliant HTML layout and rendering engine written in PHP. It is a style-driven renderer: it will download and read external stylesheets, inline style tags, and the style attributes of individual HTML elements. It also supports most presentational HTML attributes.

The problem with DOMPDF however, is that the developers stopped being active, this despite a known security vulnerability that would allow an attacker to access any file readable by the webserver. I quickly got to patching the code within Bamboo, but there was no way to back-port to the main project, and the developers were unresponsive. Not a feature, or extra functionality, but a critical security vulnerability. Let me be clear, I have no problem with them not wanting community code, but a known security vulnerability needed to be patched.

Today an interesting thing happened. A community member (I believe Ryan Masten based on project ownership) contacted the original developers and asked to take over the project and move it to Google Code.

Thanks for your interest in the project and your initiative in taking it forward.  I don’t have a problem with you or others maintaining and contributing to dompdf.

With that, reins were handed over, and DOMPDF is once again being actively developed at http://code.google.com/p/dompdf/. I’m very excited for the future of this excellent project.

DOMPDF on Google Code

Comments

Marco wrote on

Great article Derek,
you are right,no great support or a decent PDF library to play with until now.I played with dompdf a bit,but it had some memory lacks when used with a local installation of apache(XAMPP).
At the end i decided to use TCPDF within codeigniter as a module,and as you told,with no support for CSS and telling the trouth difficult to learn in short time(Anyway now it plays well).
So i think that a great class as DOMPDF,with support for html and css, could represents the next future of PDF libraries if people(good as you) from the web comunity will support it.

Marco

Nicruo wrote on

Hi Derek.
Thank you for your article. I didn’t knew that dompdf was back on track.
Keep the good work.

Thorpe Obazee wrote on

It’s a good thing that it’s again being actively developed. It’s kinda hard using a library that might cause errors because of un-updated code. I hope more features are added probably like more complex html and css :)

Iverson wrote on

Have you used this with CI?

Derek wrote on

Have you used this with CI?

BambooInvoice uses it, and is built on CodeIgniter.