New to DOMPDF

101 views
Skip to first unread message

Chris Pashalis

unread,
Apr 1, 2014, 5:11:44 PM4/1/14
to dom...@googlegroups.com
Hello fellow DOMPDF gurus!

I am completely new to this.  I am well versed in HTML, CSS, Javascript, Jquery, and a little bit of PHP.  Is there a link to a tutorial somewhere that can show me exactly how to use this?  I see documentation on the language but it is very cumbersome.  My main objective here is to be able to print php variables to a pdf, preferably an already created pdf with blank sections for future variables to be inserted.  I really have scoured the internet for more information and have come up empty handed.  Any feedback would be terrific.

Tomas Rimkus

unread,
Apr 2, 2014, 12:16:57 PM4/2/14
to dom...@googlegroups.com
Generate your html whatever way you like and use the following.
       require_once("/Path/To/dompdf/dompdf_config.inc.php");
        $dompdf = new DOMPDF();
        $dompdf->load_html($MyValidHtml);
        $dompdf->set_paper('A4');
        $dompdf->render();

        //Either output to file
        $output = $dompdf->output();
        file_put_contents('test.pdf', $output);

        //Or to the browser
        $dompdf->stream('test.pdf', array("Attachment" => false));
Reply all
Reply to author
Forward
0 new messages