github mpdf/mpdf v7.0.0
Version 7.0.0 (finally) released

latest releases: v8.2.3, v8.2.2, v8.2.1...
6 years ago

Version 7.0 is a large code cleanup release with introduction of namespaces, code structure cleanup, introduction of PSR compliant file structure and autoloading. It requires at least PHP 5.6 and is tested with up to PHP 7.2.

See CHANGELOG for the complete list of changes, fixes and enhancements and README for the quick tour.

See a documentation chapter on upgrading.

Breaking changes & Removals

Composer is now the only officially supported installation method. There are no pre-packaged library archives.

All classes moved under Mpdf namespace. Main class renamed to Mpdf. Now accepts single $config array parameter in its constructor.

Most side-effects of the former mpdf.php file were removed.

Progressbar and graph features were removed.

All global constants were removed in favor of class constants or configuration directives.

All errors are now thrown as exceptions extending \Mpdf\MpdfException.

Enhancements

Support for up to PHP 7.2. File & directory structure cleanup, PSR-4 autoloading. Refactoring of many easy-to-separate code portions.

Support for multiple font directories. PDF/A-3 associated files + additional xmp rdf support.

Introduced PSR-3 logging.

Library name

There can be a bit of confusion about the library name casing with introduction of PSR-compliant class naming.

The name of the library is still mPDF.

Main namespace is Mpdf, FQN of the main class is \Mpdf\Mpdf, packagist package is mpdf/mpdf.

Support our work

We welcome any donation.

Yaaay! 2 000 000 downloads 🎉!

The mpdf/mpdf Packagist package surpassed the 2 milion downloads some time around October 14th. Thanks for showing us the appreciation this way.

Future development

The v7.0 is far from perfect. It retained many of 6.x branch flaws, incomplete CSS support, far-from-perfect architecture.

The main goal of this version was to start giving the code a clean and defined structure and slowly starting decomposing it to smaller parts. This helped add support for newer PHP versions.

There are many things to be done, some of them are laid out in the Issues tracker here on GitHub.

mPDF now should follow semver. All reported notice and warning fixes will be continually solved in patch releases, smaller new functionality can be added in minor releases. Breaking changes will have to wait for major releases, in this case v8.

Thanks

Many thanks to all small contributors to the library mentioned in the changelog, sorry to anyone who was missed.

Special thanks to @Klap-in for his extensive work on the documentation.

Don't miss a new mpdf release

NewReleases is sending notifications on new releases.