Manol Posted August 23, 2013 Posted August 23, 2013 Hello. I have tried to use mpdf but I get an error. Here is waht I did: downloaded mpdf from here. uploaded to /templates/includes/MPDF57 given writing permission to /tmp/ and /graph_cache/ imported in the template <?php if(!$config->ajax) include("./includes/MPDF57/mpdf.php"); ?> addes the following very basic code: $mpdf = new mPDF(); $mpdf->WriteHTML('<p>Your first taste of creating PDF from HTML</p>'); $mpdf->Output(); exit; but when I trie to use it I get the message: Failed to load PDF document.
Manol Posted August 23, 2013 Author Posted August 23, 2013 it is working using ob_end_clean() that erase the output buffer and turn off output buffering ob_end_clean(); $mpdf = new mPDF(); $mpdf->WriteHTML('<p>Your first taste of creating PDF from HTML</p>'); $mpdf->Output(); exit; 4
horst Posted August 23, 2013 Posted August 23, 2013 @Manol: that's a good find. They have wide support for HTML and CSS and also using different fonts is just a snap.
owzim Posted August 23, 2013 Posted August 23, 2013 Wow this is a full fledged browser rendering to pdf, gonna try that out soon.
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now