Convert HTML output of a PHP script to PDF?

Demetrius

New Member
I have two files located in \[code\]localhost/invoice\[/code\] named \[code\]x.php\[/code\] and \[code\]template.php\[/code\],and then I have a URL like this:\[quote\] localhost/invoice/template.php?name=wawan\[/quote\]How can I convert the output page into a PDF? What I want is to access \[code\]x.php\[/code\] and then get the converted \[code\]template.php\[/code\]. I tried using mpdf, but it doesn't work.Here's \[code\]x.php\[/code\]:\[code\]<?phpinclude("MPDF54/mpdf.php");$mpdf=new mPDF('c','A4','','' , 0 , 0 , 0 , 0 , 0 , 0); $mpdf->SetDisplayMode('fullpage');$mpdf->list_indent_first_level = 0; // 1 or 0 - whether to indent the first level of a list$mpdf->WriteHTML(file_get_contents('template.php?name=wawan'));$mpdf->Output();?>\[/code\]And this is \[code\]template.php\[/code\]:\[code\]<div> The name is :<?phpecho $_GET[name];?>\[/code\]
 
Back
Top