dompdf integration
-
Hello there,
I want to convert html template into pdf, for that i need dompdf.
I download that from github (https://github.com/dompdf/dompdf/releases/download/v2.0.0/dompdf_2-0-0.zip) extract that and upload into child theme section.
In functions.php added following code for testing
add_action( 'wp_footer', 'temp' ); function temp(){ include_once( get_stylesheet_directory() .'/dompdf/autoload.inc.php'); use Dompdf\Dompdf; define('DOMPDF_UNICODE_ENABLED', true); $dompdf = new Dompdf(); $dompdf->load_html("<h1>Hello World</h1><p>PDF description</p>"); $dompdf->setPaper('A4','potrait'); $dompdf->render(); $dompdf->stream('title.pdf'); }
When i reload my page its shown error There has been a critical error on this website.
please advise.
Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
- The topic ‘dompdf integration’ is closed to new replies.