Download the PHP package trianity/laravel-mpdf without Composer

On this page you can find all versions of the php package trianity/laravel-mpdf. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package laravel-mpdf

Laravel mPDF

Laravel integration for mPDF, maintained in the Trianity GitHub repository. It provides a small wrapper for generating PDF files from HTML, files, and Laravel views.

Requirements

Installation

The service provider and PDF facade are registered automatically by Laravel package discovery.

Dependency injection is also supported:

Usage

The wrapper supports the following methods:

Chunk methods split the rendered HTML at the supplied separator and write each part separately. This can help with large HTML documents and PCRE backtrack limits. The separator must not be an empty string.

The returned LaravelMpdf instance provides:

output() returns the PDF contents. save() returns the supplied path. download() and stream() send the PDF directly through mPDF and return nothing.

Configuration

Publish the configuration file with:

The published file is config/pdf.php. It contains the mPDF defaults used by the wrapper, including page format, margins, fonts, language detection, watermarks, PDF/A, and temporary directory settings.

Configuration can also be overridden for an individual document. The per-document values take precedence over the application configuration:

Custom fonts

Set a font directory and font data in config/pdf.php:

Use the font in your HTML/CSS as font-family: examplefont;.

Headers and footers

mPDF headers and footers can be defined in the HTML and CSS passed to the wrapper:

See the mPDF documentation for the complete list of supported HTML, CSS, and configuration options.

Testing

Install the development dependencies and run the complete local check with:

The check runs Pest, Larastan/PHPStan, and Pint.

Attribution

The package has an earlier history in the Trianity GitHub repository. The previous clone was abandoned and the current codebase was rewritten by Trianity while preserving the supported public API and configuration behavior.

The source still contains the original Carlos Meneses author attribution. The current package namespace and maintenance are provided by Trianity.

Notes

mPDF may block while fetching external HTTP resources when the application runs on a single-threaded server such as php -S or artisan serve. Use a production web server for applications that need external resources.

License

This package is open-sourced software licensed under the MIT license.


All versions of laravel-mpdf with dependencies

PHP Build Version
Package Version
Requires php Version ^8.4
illuminate/support Version ^12.0|^13.0
mpdf/mpdf Version ^8.3
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package trianity/laravel-mpdf contains the following files

Loading the files please wait ...