Jump to content
Manol

How to include mpdf

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.

Share this post


Link to post
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

Share this post


Link to post
Share on other sites

Wow this is a full fledged browser rendering to pdf, gonna try that out soon.

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...