I want to generate PDF in my custom module. Using print module we can print node. But I have made html in my custom module and that I wanted to make pdf and save it in files.
I have tried custom dompfg library but its working. i wanted to do something like this:
$html = "<h1>Header</h1><P>Pdf generated.</p>"; include ("mpdf.php"); /// This will be something to include for mpdf $mpdf=new mPDF('win-1252','A4','','',20,15,48,25,10,10); $mpdf->WriteHTML($html); $mpdf->Output('../default/files/users/filename.pdf','F'); exit;