Possible Duplicate:
Convert HTML + CSS to PDF with PHP?
I want to convert page like this http://alexking.org/projects/html-resume-template/demo/resume.php to开发者_开发技巧 pdf on the fly by a link inside the page, I tried dompdf but failed to have the result.
I has some success with HTML2PDF, give it a try. Example:
$content = get_include_contents('/resume.php');
require_once(dirname(__FILE__).'/html2pdf/html2pdf.class.php');
$html2pdf = new HTML2PDF('P', 'A4', 'en');
$html2pdf->WriteHTML($content);
$html2pdf->Output('example.pdf');
Check out Zend_PDF(), which provides all possibilities. If you need a bigger freedom and other formatting, I'd recommend to use latex and a latex2pdf
-call, but this one might be a bit much for what you want to achieve.
Unfortunatly, I haven't seen a decent html2pdf-generator so far.
What about http://www.php.net/manual/en/pdf.examples-basic.php ?
I've found this to be very good http://code.google.com/p/wkhtmltopdf/. It uses the webkit engine.
Personally I use TCPDF. It fully supports UTF-8 and you don't need any external libraries to use it.
精彩评论