Exemple #1
0
 public function createPDF($url)
 {
     $url = 'http://clients.skiify.com/eximagen/en/boligrafos-plasticos/430-boligrafo-pilot.html';
     require_once '/html2pdf/html2fpdf.php';
     // Create new HTML2PDF class for an A4 page, measurements in mm
     $pdf = new HTML2FPDF('P', 'mm', 'A4');
     $buffer = file_get_contents($url);
     var_dump($buffer);
     // Optional top margin
     $pdf->SetTopMargin(1);
     $pdf->AddPage();
     // Control the x-y position of the html
     $pdf->SetXY(0, 0);
     $pdf->WriteHTML($buffer);
     // The 'D' arg forces the browser to download the file
     $pdf->Output('MyFile.pdf', 'D');
 }