Home
Docs
GitHub
Pricing
Blog
Log In

Run Sandworm Audit for your App

Get started
Hold on, we're currently generating a fresh version of this report
Generated on May 26, 2024 via composer

mpdf/mpdf v6.1.2

A PHP class to generate PDF files from HTML with Unicode/UTF-8 and CJK support
Package summary
Share
4
issues
3
high severity
vulnerability
2
license
1
1
low severity
license
1
2
licenses
1
GPL-2.0
1
MIT
Package created
12 Sep 2012
Version published
20 Jul 2016
Maintainers
2
Total deps
2
Direct deps
1
License
GPL-2.0

Issues

4

3 high severity issues

high
via: mpdf/mpdf@v6.1.2
via: mpdf/mpdf@v6.1.2
Recommendation: Validate that the package complies with your license policy
via: mpdf/mpdf@v6.1.2
Collapse
Expand

1 low severity issue

low
via: mpdf/mpdf@v6.1.2
Collapse
Expand

Licenses

GNU General Public License v2.0 only

Strongly Protective
OSI Approved
Deprecated
This is a human-readable summary of (and not a substitute for) the license. Disclaimer.
Can
commercial-use
modify
distribute
place-warranty
Cannot
sublicense
hold-liable
Must
include-original
disclose-source
include-copyright
state-changes
include-license
1 Packages, Including:
mpdf/mpdf@v6.1.2

MIT License

Permissive
OSI Approved
This is a human-readable summary of (and not a substitute for) the license. Disclaimer.
Can
commercial-use
modify
distribute
sublicense
private-use
Cannot
hold-liable
Must
include-copyright
include-license
1 Packages, Including:
setasign/fpdi@1.6.2
Disclaimer

This deed highlights only some of the key features and terms of the actual license. It is not a license and has no legal value. You should carefully review all of the terms and conditions of the actual license before using the licensed material.

Sandworm is not a law firm and does not provide legal services. Distributing, displaying, or linking to this deed or the license that it summarizes does not create a lawyer-client or any other relationship.

Direct Dependencies

1
All Dependencies CSV
β“˜ This is a list of mpdf/mpdf 's direct dependencies. Data on all dependencies, including transitive ones, is available via CSV download.
NameVersionSizeLicenseTypeVulnerabilities
setasign/fpdi1.6.227.02 kBMIT
prod

Visualizations

Frequently Asked Questions

What does mpdf/mpdf do?

mPDF is a renowned PHP library that facilitates the generation of PDF files from HTML content encoded in UTF-8. It leverages the functionality of FPDF and HTML2FPDF, with numerous enhancements to provide a flexible and feature-rich platform for generating PDF files. mPDF is written by Ian Back and is open-source, available under the GNU GPL v2 licence. Its popularity is evident from numerous downloads on Packagist and it enjoys a wide base of users due to its versatility and compatibility with multiple PHP versions, from PHP 5.6 to PHP 8.2.

How do you use mpdf/mpdf?

Getting started with mPDF is straightforward, especially if you have Composer installed on your system. Install mPDF by executing the command $ composer require mpdf/mpdf in your terminal. This will add mPDF to your PHP project.

To use mPDF in your PHP code, first require the Composer autoloader through require_once __DIR__ . '/vendor/autoload.php';. Following this, create an instance of mPDF through new \Mpdf\Mpdf();. You can then write HTML content to the PDF with the WriteHTML function, and finally output the PDF either inline to the browser with the Output function.

Below is a simple usage example:

<?php

require_once __DIR__ . '/vendor/autoload.php';

$mpdf = new \Mpdf\Mpdf();
$mpdf->WriteHTML('<h1>Hello world!</h1>');
$mpdf->Output();

Take note of the versatility of mPDF configuration. All configuration directives can be established by the $config parameter of the mPDF constructor. For example, you can define a custom temporary directory by setting the tempDir configuration variable:

<?php

$mpdf = new \Mpdf\Mpdf(['tempDir' => __DIR__ . '/tmp']);

Where are the mpdf/mpdf docs?

Comprehensive documentation for mPDF is easily accessible via https://mpdf.github.io/. The mPDF online manual covers everything from getting started, to setup & configuration, and even explains more advanced topics. It's a valuable resource for understanding mPDF usage and ensuring seamless integration of mPDF in your PHP projects. For troubleshooting, the manual provides a section on common issues and provides practical solutions. Developers can also engage with other mPDF users and contributors on GitHub Discussions or the Stack Overflow 'mpdf' tagged questions for interactive problem-solving.