mypdf / mpdf
A PHP class to generate PDF files from HTML with Unicode/UTF-8 and CJK support
v6.1.4
2020-05-21 13:41 UTC
Requires
- php: 7.0.*
- setasign/fpdi: 1.6.*
Suggests
- ext-zlib: Needed for compression of embedded resources, such as fonts
This package is auto-updated.
Last update: 2025-04-22 19:50:53 UTC
README
mPDF is a PHP class which generates PDF files from UTF-8 encoded HTML. It is based on FPDF
$mPdf = new mPDF('UTF-8', 'A4', 14, '', 10, 10, 15, 1); $mPdf->SetDisplayMode('real'); $mPdf->autoScriptToLang = true; $mPdf->autoLangToFont = true; $mPdf->WriteHTML($html); if ($logo) { $mPdf->Image($logo, 130, 135, 41, 27); } if ($name) { $mPdf->Image($name, 63, 138, 20, 8); } if (!$pdfName) { $pdfName = self::AGREEMENT_PATH . rand(1, 1000000) . '.pdf'; } $mPdf->Output($pdfName);