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
7
votes
2 answers

mpdf ignoring javascript

I have a question here.. I have used buffering to get the pdf files using mpdf.. but I got a little confused here.. I have some javascript on the page that I was buffering.. but the generated content from javascript is not getting converted into…
Wawan Brutalx
  • 603
  • 6
  • 15
  • 27
6
votes
3 answers

MPDF No Output (Blank Page)

I'd installed the MPDF utility in order to convert HTML&CSS to PDF reports. So far things have been working just fine, until I've tried converting certain page to PDF ,and there's no output. I have to mention that i'm able to display the page…
user975343
6
votes
0 answers

Generation mPDF very Slow on AWS (Serverless Docker) compared to a Ubuntu VPS

I have some big differences in time thats needed to generate a mPDF. On an AWS (Serverless with Docker) hosted Application it took me 25 seconds to generate a PDF, while that identically same PDF took 5 seconds to generate on a VPS with Ubuntu…
user1469734
  • 851
  • 14
  • 50
  • 81
6
votes
3 answers

Laravel - Outputting a view styled with TailwindCSS as PDF

I'm trying to make generate a pdf from a view but the styles just won't come out. I've tried using 3 different libraries but the results aren't much different. Am I missing something? view
IGP
  • 14,160
  • 4
  • 26
  • 43
6
votes
2 answers

Generate fillable / editable PDF in Laravel

I am generating DOM PDF in laravel using barryvdh/laravel-dompdf package. It is working fine by rendering the views and HTML elements with readonly mode. But, I am trying to generate fillable / editable PDF so that user can enter details with out…
Divakar Gujjala
  • 803
  • 8
  • 24
6
votes
0 answers

mpdf output document to html

Can I output the mpdf document as HTML string or file instead of a pdf? It will be helpful for debugging. Example: $mpdf->WriteHTML($page_config_css,…
ramiwi
  • 902
  • 2
  • 10
  • 28
6
votes
1 answer

Call to undefined function Mpdf\mb_regex_encoding()

i want to make some reports with yii2 Mpdf but when i running the program i got an error like Call to undefined function Mpdf\mb_regex_encoding() please tell me how to solved this program this is my controller public function actionRpt($id) { …
Owl
  • 63
  • 1
  • 3
6
votes
1 answer

MPDF div not working inside table

I am working on mpdf and it is a good library to convert html page to pdf, but when I put block element e.g

inside table cell it doesn't behave like a block element, it behaves like inline element. code:

Block…
angel enanod
  • 431
  • 1
  • 5
  • 12
6
votes
1 answer

PHP: Adobe Reader can't open PDF files created with mpdf

I'm using mpdf to create PDF files on the fly, and the files open fine in a browser but Adobe gives me an error: Adobe Acrobat Reader DC could not open 'example-filename.pdf' because it is either not a supported file type or because the file…
Potato_potato
  • 89
  • 1
  • 5
6
votes
1 answer

mPDF center on PDF for print

I am trying to center where it says Detailed Catalog Description. I want the page to to be centered only from A1-G1 and then I merged and centered Detailed Product Catalog in that. The Problem is that, when I output to PDF it still way off to the…
Kmiles1990123
  • 189
  • 2
  • 12
6
votes
0 answers

php convert a page to pdf loading with id

I have a dynamic loading from MySQL DB, and my page URL is http://localhost/far/contractview?ID=137. When I am trying to convert this page to a PDF, I am getting a few errors, and I do not know what to do in order to convert this page to a PDF in a…
user2989676
  • 129
  • 3
  • 8
6
votes
2 answers

How to get MPDF to render Bootstrap Table Styles

I've been trying for a while now to create a pdf of a bootstrap page with mpdf and not lose table and other styling. From what I've read on mpdf site is that the styles I'm referring to are supported, so not sure what the problem is. Other styling…
Chris
  • 893
  • 10
  • 23
6
votes
2 answers

mPDF - bad background-image quality in Firefox PDF viewer

I create a PDF (using php library mPDF) with a full size background image on the body tag: body { background: url("..path/to/bg.jpg") center no-repeat; background-size: cover; background-image-resize: 6; background-image-resolution:…
xsonic
  • 195
  • 4
  • 11
6
votes
1 answer

mPDF page-break-inside avoid not working

Can somebody tell me why mPDF doesn't accept this code to avoid page break inside my div
multi line content
Manic Depression
  • 1,000
  • 2
  • 16
  • 34
6
votes
7 answers

MPDF undefined index error

I am using MPDF library to convert HTML to PDF. Here is my code. $HTML = '{HTML CONTENT GOES HERE}'; //HTML STRING $MPDF->WriteHTML($html); // Converting $MPDF->Output('preview.pdf','F'); //Saving to a File It works , but generating too much…
Red
  • 6,230
  • 12
  • 65
  • 112