Home
Docs
GitHub
Pricing
Blog
Log In

Run Sandworm Audit for your App

Get started
Generated on May 15, 2024 via composer

mpdf/mpdf v8.2.2

PHP library generating PDF files from UTF-8 encoded HTML
Package summary
Share
2
issues
2
high severity
license
1
meta
1
2
licenses
6
MIT
1
GPL-2.0-only
Package created
12 Sep 2012
Version published
7 Nov 2023
Maintainers
2
Total deps
7
Direct deps
6
License
GPL-2.0-only

Issues

2

2 high severity issues

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

Licenses

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
6 Packages, Including:
mpdf/psr-http-message-shim@v2.0.1
mpdf/psr-log-aware-trait@v3.0.0
myclabs/deep-copy@1.11.1
paragonie/random_compat@v9.99.100
psr/log@3.0.0
setasign/fpdi@v2.6.0

GNU General Public License v2.0 only

Strongly Protective
OSI Approved
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@v8.2.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

6
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
mpdf/psr-http-message-shimv2.0.19.53 kBMIT
prod
mpdf/psr-log-aware-traitv3.0.0-MIT
prod
myclabs/deep-copy1.11.122.96 kBMIT
prod
paragonie/random_compatv9.99.1005.93 kBMIT
prod
psr/log3.0.06.77 kBMIT
prod
setasign/fpdiv2.6.0-MIT
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.