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 CSS and generates a clean PDF.
Here’s some code, just to show how simple it is.
$html = "[an entire HTML document]";
$pdf = new DOMPDF();
$pdf->load_html($html);
$pdf->render();
$pdf->stream("hello_world.pdf");
It’s free, and needs nothing but PHP5 and the DOM extension.
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…