Jump to content

How to include mpdf


Manol
 Share

Recommended Posts

Hello.

    I have tried to use mpdf but I get an error. Here is waht I did:

  1. downloaded mpdf from here.
  2. uploaded to /templates/includes/MPDF57
  3. given writing permission to /tmp/ and  /graph_cache/
  4. imported in the template <?php  if(!$config->ajax) include("./includes/MPDF57/mpdf.php"); ?>
  5. 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.

Link to comment
Share on other sites

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; 
  • Like 4
Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...