Download Latest Version Version 8.1.0 released.zip (46.6 MB)
Email in envelope

Get an email when there's a new version of mPDF

Home / v8.1.0
Name Modified Size InfoDownloads / Week
Parent folder
README.md 2022-04-16 2.0 kB
Version 8.1.0 released.tar.gz 2022-04-16 46.5 MB
Version 8.1.0 released.zip 2022-04-16 46.6 MB
Totals: 3 Items   93.1 MB 96

Version 8.1.0 contains cleanups, fixes, a few code refactorings most importantly leading to a new experimental feature of internal services container.

Note: as this is an experimental feature, key names and interface names for container services can and will change in future versions.

Container

A new optional parameter has been added to the Mpdf class constructor. It expects an instance of \Mpdf\Container\ContainerInterface (which is compatible and in mPDF 10.0 will be replaced by proper PSR-11 ContainerInterface), which can now override two internal services: HTTP client, and local filesystem resource loader.

HTTP Client

The Mpdf\Http\ClientInterface, also compatible with and planned to be upgraded to PSR-7 HTTP Client, can be used by the httpClient key of the passed Container and used to restrict remote HTTP calls, implementing HTTP requests cache, altering incoming responses etc. With a simple bridge, it can be used to leverage already used HTTP client in an existing application, such as Guzzle or Symfony HTTP Client.

By default, a simple implementation based on curl (if available) or sockets (as a fallback) is used.

Local filesystem content loader

The simple Mpdf\File\LocalContentLoaderInterface is used to load local content. Custom implementation by the container key localContentLoader can implement restrictions for certain directories of the filesystem to prevent outside HTML code loading unwanted files. Default implementation uses a simple file_get_contents call.

Unwanted stream wrappers are handled for all local and remote content fetches in an encapsulating internal service.

Support our work

Thank you for any work you put into mPDF - refactorings, bug fixes, new feature requests.

We also welcome any donation.

Yaaay! 22 million (!) downloads 🎉!

Hope number of downloads will keep rising!

Source: README.md, updated 2022-04-16