Prince: Overview: There’s a big gap in getting Web content into print.
I’ve had to cross the gap a couple times, and I’ve both generated PDFs server-side and used CSS to style HTML into printable format. Both methods suck.
Prince is a system that lets you take XML, style it with CSS, and then generate a PDF. It’s very good — I’ve seen demos, and their site is full of them. Look at the image with this post — that’s HTML converted to PDF, unattended.
But it’s still expensive — $3,800 for a server license? Ouch.
Prince is a computer program that converts XML into PDF documents. Prince can read many XML formats, including XHTML and SVG. Prince formats documents according to style sheets written in CSS.
What are the free alternatives? It’s a pretty bare field. There’s XML:FO, but I never had much luck with that (and I detest XSL, which doesn’t help). Recently, I was impressed with FPDF, which is a PHP class that will generate simple PDFs from HTML.
Via A List Apart which has a whole article on the problem.
dompdf - The PHP 5 HTML to PDF Converter: Someone mentioned this over in the post on Prince. It looks quite good -- they have a demo page where you can enter HTML in a box, then generate a PDF real-time. I tried it -- it respects all…
I found a peach of a tool today — it was exactly what I was looking for at exactly the right time. We have a central database at my company, and the guys have been bugging me to work up some enhanced printing for it. They want to be able…
R&OS: pdf class: Here's an insanely well-done PHP class for creating PDFs on the fly. Ridiculously simple. Written by a Kiwi, no less. We rule.
Not free, but cheaper is CeTe Software's DynamicPDF Generator: http://www.cete.com/Products/GeneratorForNET/
We paid under $600 for our server license.
I am working on a project where we have letter templates in XSL:FO and merge the data using StringTemplate. We then render the resulting XSL:FO to PDF using XF Rendering Server 2005, which is a little more affordable at $995.
I think it works pretty well. Creating the XSL:FO templates can be a bit tedious, but a companion product called XF Designer is available along with XF Rendering Server 2005.
Take a look at http://www.digitaljunkies.ca/dompdf/ it's free but less flexible
Actually, there is another solution, which is not that bad: http://www.wikipublisher.org/wiki/
The problem with html to pdf is not necessarily the actual conversion, but the layout of the pdf. For example, reading a pdf document formatted in landscape with multi-column view is not reader-friendly for the web. Or for example, producing a bibliography, or an index that is dynamic. The author of wikipublisher is on the right track.