Download the PHP package chrisbraybrooke/laravel-chrome-pdf without Composer
On this page you can find all versions of the php package chrisbraybrooke/laravel-chrome-pdf. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package laravel-chrome-pdf
Laravel PHP Chrome HTML to PDF
Important note regarding git
If you keep you vendor folder in source control - then you may want to consider placing the following in you .gitignore
file. The reason for this is that the chromium rendering engine contains files that are larger than GitHubs 100mb limit.
How it works
This library is based on puppeteer, a headless Chrome Node API which is maintained by the Chrome DevTools team.
It provides a simple PHP / Laravel wrapper around the Node API, focused on generating beautiful PDF files.
In contrast to other HTML to PDF converters like wkhtmltopdf, the corresponding PHP wrapper or similar libraries, it is based on a current Chrome version instead of outdated and unmaintained WebKit builds. This library therefore fully supports CSS3, HTML5, SVGs, SPAs, and all the other fancy stuff people use these days.
Installation
Setup:
Laravel >=5.5
Laravel 5.5 and above uses package autodiscovery so you are all done! Skip to Usage.
Laravel 5.5<
If you are using Laravel 5.4 or below, you will have to manually register the package. After updating composer, add the ServiceProvider to the providers array in config/app.php
.
And optionally add the Facade.
Usage:
Below is an example of creating a simple PDF from a blade file.
Outputs:
There are several methods of outputting the PDF.
Of course download
is available.
Use inline
to show the PDF inline in the browser.
Or save
to save the file to the filesystem. The first argument is the filename / path - and the second is the disk to be used.
Options:
It is simple to set options for the PDF.
Just use the setOption
or setOptions
methods.
Or set multiple options at once.
All available php-chrome-html2pdf options are available.
There are also a few helper methods, which can be chained.
Maintenance:
My company Purple Mountain - A web development company in the UK, will try our best to keep this package up to date and free from any issues.
All versions of laravel-chrome-pdf with dependencies
illuminate/filesystem Version 5.5.x|5.6.x|5.7.x|5.8.x
php Version >=7.0
spiritix/php-chrome-html2pdf Version 1.3.*