Questions tagged [mpdf]

mPDF is a PHP library for generating PDF files from HTML with Unicode/UTF-8 and CJK support. It is distributed under the GNU General Public License. Although it is slower than its protoplast (fpdf library) it supports Unicode characters while fpdf does not.

mPDF is a PHP class which generates PDF files from UTF-8 encoded HTML. It is based on FPDF and HTML2FPDF, with a number of enhancements.

1514 questions
13
votes
7 answers

mPDF temporary file is not writable using Yii

I tried to print a certificate in PDF but when I push my code to staging, it said Temporary files directory "/var/www/protected/vendor/mpdf/mpdf/src/Config/../../tmp" is not writable I'm not sure how to change the permission and how to change the…
rryys
  • 179
  • 2
  • 2
  • 9
13
votes
9 answers

How to set the page in landscape mode in mpdf?

I am using mpdf library in PHP to create a pdf file from HTML. I need to set the page mode in landscape mode. Here is the code I am using : $mpdf=new mPDF('c'); $mpdf->WriteHTML($html); $mpdf->Output(); exit; However, this is setting the page…
Kiran
  • 8,034
  • 36
  • 110
  • 176
13
votes
4 answers

php mpdf memory limit error

For the first time im using mpdf library and everything worked fine. I wrote a script to create pdf file which consist a table of 274 rows. When i run the script i get php memory error. I tried different scenario but i get the same memory error.…
sravis
  • 3,562
  • 6
  • 36
  • 73
12
votes
4 answers

mPDF auto print issue

I'm using a php class, mpdf, which generates PDF's very nicely. I'm trying to get the file to automatically print (i.e., open the print dialog) when rendered. I've extended the core functioning with the code below to add javascript to the pdf. …
mozgras
  • 3,215
  • 3
  • 21
  • 17
12
votes
3 answers

PDF not merge greater than PDF-1.5 version using mPDF

I try to merge pdf using mPDF plugin with latest version but the error coming PDF merging working when using pdf version 1.3 but not done for 1.5 I have try below code Generate PDFs with merge '; …
Rax Shah
  • 531
  • 5
  • 18
12
votes
2 answers

mPDF - footer is working only on last page

I saw the other similar questions here, but I couldn't resolve my problem. My problem is: the header is working normally in all pages, but the footer is showing only on last page.
alexandre9865
  • 493
  • 2
  • 9
  • 24
12
votes
3 answers

mPDF font-size not working for long text in a table

Using mPDF to print html to pdf the font-size I set in html is not properly set in creating the pdf. In my html I have
zef
  • 649
  • 1
  • 7
  • 22
11
votes
7 answers

mPDF not rendering images (mPDF error: IMAGE Error Could not find image file)

We are getting plagued with this which started in April on working server. Everything was fine with our application until the customer reported that PDFs were no longer displaying the images. Our PDF is generated via a HTML render first. When the…
alcomcomputing
  • 307
  • 1
  • 4
  • 17
11
votes
5 answers

mpdf not supporting arabic and chinese fonts

I am using mpdf. When I supplied the arabic and chinese words to the WriteHtml(), the resulting pdf containing square boxes instead of those fonts. Please suggest! Sample fonts: I am testing أنا العالم 我的世界
pavan kumar
  • 391
  • 3
  • 6
  • 13
10
votes
2 answers

Display pdf generated using mpdf inline in mobile browsers

Is there any way to display pdf generated using mpdf inline in mobile browsers? I went through mpdf documentation and tried destination option mpdf->output('filename.pdf','I'). It works pretty well across every browser in desktop except IE and…
Vishwas R
  • 3,340
  • 1
  • 16
  • 37
10
votes
4 answers

PHP - How to use mPDF to merge PDFs

I will start out by saying that I can generate PDFs just fine with mPDF, but for the life of me, I can't get it to merge an existing PDF with the PDF it just generated. What I need to figure out is how to append/add the existing PDF to the newly…
cvanorman
  • 138
  • 1
  • 2
  • 13
10
votes
4 answers

How to create editable Pdf form in php

I have a simple form and I want to make it editable in pdf using php. But the pdf is creating the form but I can't edit and submit it, any reason or I can't edit pdf using php? My code is
Rohan Kumar
  • 40,431
  • 11
  • 76
  • 106
9
votes
5 answers

Upgrade to PHP7.1 and MPDF show error - A non-numeric value encountered at line 30648

I'm using PHP 5.x and mPDF 6.x for long time. This week I decide to upgrade system to PHP7.1 but still using mPDF6. I face some problem after upgrading. PROBLEM 1:: Console show error message: constructer with the same name as class name is…
Chanatip Yim
  • 356
  • 1
  • 3
  • 11
9
votes
3 answers

How to delete blank page in mPdf

I am converting an html file to PDF by using mPdf, but the returned PDF file includes blank pages. I want to delete those blank pages.
9
votes
1 answer

How to set custom page size in mPDF?

I need some help with mPDF. I want to set up my custom page size (exactly: width 49mm and height 200mm), but I can not find solution. I found mPDF() manual (http://mpdf1.com/manual/index.php?tid=184) but there are only ready formats like A4, B5 etc.…
ZaquPL
  • 789
  • 2
  • 12
  • 28