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
5
votes
1 answer

Issues with MPDF and overflow:hidden on nested divs

I am trying to get MPDF to correctly print divs with overflow:hidden. I've read their documentation up and down and tried various things. No luck. Per mpdf, block elements with overflow:hidden must have position:absolute or position:fixed set. That…
Alexey Gerasimov
  • 2,131
  • 13
  • 17
5
votes
2 answers

mPDF - Page break based on element height

I'm using mpdf in Laravel and with this package version 4.0 The problem is that I have a list of questions in different heights which have 4 options, and I don't know the exact and approximate height of every div tag which question and answer…
Ali
  • 1,525
  • 1
  • 16
  • 27
5
votes
3 answers

Custom font in mPDF won´t load

I'm using version 7.x of mPDF and tried to follow this documentation: https://mpdf.github.io/fonts-languages/fonts-in-mpdf-7-x.html I just can't get it to work. No errors, but the font is still the default mPDF font. I also tried to do it another…
Jonas Borneland
  • 383
  • 1
  • 6
  • 19
5
votes
4 answers

How to use bootstrap in mPDF?

I am currently using mpdf to generate my pdfs from html. So far with my current html that I am passing in, I am able to generate a one page pdf with a header and footer. However, if there is more than one page, my footer goes all the way to the…
JianYA
  • 2,750
  • 8
  • 60
  • 136
5
votes
2 answers

MPDF Checkbox not showing in PDF only dot

Im using MPDF to output my html form into a PDF. But my problem is, when it converts to PDF the box shape of checkbox is gone, below is the sample how i coded the checkbox
Yinkci Heart
  • 160
  • 1
  • 14
5
votes
3 answers

MPDF Fatal error: Interface 'Psr\Log\LoggerAwareInterface' not found

I'm trying to use MPDF but when loading it I get the following error, does anyone know why?https://github.com/mpdf/mpdf My Code
CristianOx21
  • 217
  • 1
  • 4
  • 16
5
votes
1 answer

PHPMailer - send PHP generated PDF (mPDF) as attachment

I know how to generate PDF using mPDF library and send it as attachment using PHPMailer - something like this: ... $emailAttachment = $mpdf->Output('file.pdf', 'S'); $mail = new PHPMailer(); $mail->AddStringAttachment($emailAttachment, 'file.pdf',…
Ján Janočko
  • 460
  • 2
  • 7
  • 19
5
votes
3 answers

mPDF: how to remove setHeader() & setFooter() borders

i have a mPDF report on my system and in the report, it has a header and footer where i use $mpdf->setHeader(); & $mpdf->setFooter(); to set the header and footer. but it displays a bottom border for header and top border for footer. can anyone help…
Vincent Dapiton
  • 587
  • 1
  • 9
  • 27
5
votes
1 answer

Shopware Arabic Invoice Text Not Connected

Im Using Shopware to create an arabic online shop and the problem is when shopware is creating the pdf, letters look not connected for example : ر ق م ا ل ف ا ت و ر ة while it should be رقم الفاتورة What i have tried so far is using different…
a4w
  • 567
  • 6
  • 18
5
votes
5 answers

MpdfException IMAGE Error () : Error parsing image file - Yii2

I'm stuck in very awkward situation where Images are being shown in Local Environment while generating PDF. But, Not in Production. Images being displayed as [X] when to generate PDFs with mPDF. After inserting $mpdf->showImageErrors = true; in…
Nana Partykar
  • 10,556
  • 10
  • 48
  • 77
5
votes
5 answers

How to set the height of table in mpdf

I am generating invoices using MPDF. My item rows are dynamic so the height of table which shows items should be flexible. When I am printing the PDF using following code:
عثمان غني
  • 2,786
  • 4
  • 52
  • 79
5
votes
3 answers

mPDF : text align with p , h1 - h6 in table not work

this code not work in table with mPDF php class

text align right

GoldenFingers
  • 119
  • 1
  • 2
  • 10
5
votes
0 answers

mPDF - Determine height of a element after rendering

I am using mPDF to generate PDF files from form submissions. The script is going through all questions and creating a HTML fieldset for each containing the question and the answers. Since the survey is quite long, the generated PDF spans over…
Paul
  • 8,974
  • 3
  • 28
  • 48
5
votes
2 answers

mPDF - Inline blocks not displaying side by side

I have a bunch of small tables that are formatted as inline-block elements. In the browser they display side by side as intended, but when using mPDF to output them they break after each table. No matter how I try to format them, they always break…
Kirk Logan
  • 733
  • 2
  • 8
  • 23
5
votes
4 answers

mpdf error - preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead

i'm using MPDF to generate pdf files in codeigniter. my controller function look like function save_pdf($std_id) { $data['section1_report']= $this->common_model->get_details('tbl_section1',array('id'=>$std_id)); $html =…
Sujan Shrestha
  • 612
  • 3
  • 13
  • 34