his solution uses HTML2PDF project (sourceforge.net/projects/html2fpdf/). It simply gets a HTML text and generates a PDF file. This project is based upon FPDF script (www.fpdf.org), which is pure PHP, not using the PDFlib or other third party library. Download HTML2PDF, add it to your projects and you can start coding.
Code example
require(“html2fpdf.php”); $htmlFile = “http://www.dancrintea.ro”; $buffer = file_get_contents($htmlFile); $pdf = new HTML2FPDF(‘P’, ‘mm’, ‘Letter’); $pdf->AddPage(); $pdf->WriteHTML($buffer); $pdf->Output(‘test.pdf’, ‘F’);
