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
9
votes
3 answers

Add page break after match of certain class on div with mpdf

I am converting a report (in html)to pdf using mPDF library, but is putting all pages into one. I want to add a page break after a certain but I haven't been successful. html
user2031297
  • 161
  • 1
  • 2
  • 14
9
votes
1 answer

mPDF disable page number, header and footer on first page

I just used mPDF on my project and now stuck on this problem. First let me describe my PDF structure: First page is a cover page. Second page is Table Of Content page. Third page is content page. So the problem is : There is header,footer,page…
cyberfly
  • 5,568
  • 8
  • 50
  • 67
8
votes
3 answers

mPDF: use background image for full page

I need to generate invoices with mPDF, and they all will have a header, a footer, and the same background image which has to cover the whole page. I've seen other solutions on the net but none worked for me. These are several attempts, all of them…
luis.ap.uyen
  • 1,314
  • 1
  • 11
  • 29
8
votes
4 answers

How to use mPDF for Chinese Language

I am using mPDF to save form input data to PDF. For English, it is working fine. Anyone can use this code to save HTML Form data to PDF. Issue: In order to fulfill my project requirement I need to use the Chinese Language. My current code is not…
ZiaUllahZia
  • 1,072
  • 2
  • 16
  • 30
8
votes
3 answers

MPDF how can i delete the white space margin

$style=''; $html =''; include("MPDF54/mpdf.php"); $mpdf =…
MRTY
  • 81
  • 1
  • 1
  • 7
8
votes
4 answers

Mpdf different header for first page

I am working on quotation software where I am using mpdf for quotation generation using HTML format. Header are set by code below. $mpdf->SetHTMLHeader($header); $mpdf=>SetHTMLFooter($footer); Which applies uniformly to all pages. But I need…
swapnil shahane
  • 243
  • 1
  • 4
  • 13
8
votes
2 answers

mPDF error: Unable to create output file

I am Using mPDF to generate pdf from an html. On my localhost the pdf is generated to the located directory successfully. But not on Server, although I have open the permissions of that directory. chmod -R 0777 /mydirectory Found this comment from…
Fahad Khan
  • 1,635
  • 4
  • 23
  • 37
8
votes
4 answers

change top margin of second page using mPDF

I'm dynamically generating PDFs with an unknown page count. mPDF is working good, but the top margin on the second page is gone. How can I set the margins for all pages with the document? I've tried the following, but it has no effect: $mpdf = new…
Paul Dessert
  • 6,363
  • 8
  • 47
  • 74
8
votes
4 answers

use font in mPDF generated document

I would like you to help me with this issue, I'm dealing for the first time with mPDF which I think it's great, but I want to display the report with the same type of font as my web, which on its documentations explains how to achieve this, but it…
dennisbot
  • 950
  • 1
  • 11
  • 22
7
votes
5 answers

What css alternative can I use to the non-supported margin-top:auto using mpdf to emulate footer on a4 pages?

I am trying to generate 1:1 a4 pages from my primitive wyswyg to pdf using mpdf. So using this css: #editor { background-color: gray; border: 1px black; padding: 1em 2em; } .page { background-color: white; border-style: solid; …
celsowm
  • 846
  • 9
  • 34
  • 59
7
votes
4 answers

How to fix mpdf temporary files directory writable issue?

I'm getting this error in my laravel application. Mpdf \ MpdfException (E_ERROR) Temporary files directory "/var/www/html/../temp/" is not writable Please anybody tell me the solution to fix this issue.
jawahar j
  • 183
  • 2
  • 5
  • 13
7
votes
3 answers

how to add multiple css file in mpdf

I am trying to convert my html page into pdf format using mpdf. problem is that i am unable to apply more than one css to pdf file.. here is my code of php
7
votes
3 answers

How to use Font Awesome with MPDF?

I am using Zend Framework and creating PDF with mpdf. I am trying to use fontawesome for denoting some of the articles but the fonts of font awesome are not rendering properly below is the code . $stylesheet = …
Mega Fox
  • 141
  • 1
  • 9
7
votes
2 answers

mPDF: Hide table row (CSS display:none) not work

mPDF: Hide table row (CSS display:none) not work. Do you have any suggest? My code:
InfoOption1:
Zeigen
  • 126
  • 2
  • 7
7
votes
8 answers

TCPDF & mPDF error: Some data has already been output to browser, can't send PDF file

The Problem: TCPDF & mPDF error: Some data has already been output to browser, can't send PDF file I gave up on trying to fix the error with TCPDF and installed mPDF only to get the same error when attempting to render the document to the browser. …
Patrick
  • 315
  • 1
  • 8
  • 27