Download the PHP package cavaon-wayne/laravel-browsershot without Composer
On this page you can find all versions of the php package cavaon-wayne/laravel-browsershot. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download cavaon-wayne/laravel-browsershot
More information about cavaon-wayne/laravel-browsershot
Files in cavaon-wayne/laravel-browsershot
Package laravel-browsershot
Short Description Browsershot's Laravel wrapper to generate PDF files and Screenshots using Headless Chrome
License MIT
Informations about the package laravel-browsershot
Browsershot wrapper for Laravel 6
This package takes advantage of Google Chrome's Headless mode to take screenshots and generate PDFs from websites, views and raw html
Forked from verumconsilium/laravel-browsershot
Requirements
- Node 7.6.0 or higher
- Google Chrome
- Puppeteer Node library.
You can install Puppeteer in your project via NPM:
Or you could opt to just install it globally
On a Forge provisioned Ubuntu 16.04 server you can install the latest stable version of Chrome like this:
Installation
Install the package through composer
After the package is installed the service provider will be automatically discovered and two new Facades PDF
and Screenshot
will be available
If the auto-discover not working, please add following service provider into config/app.php
Usage
The recommended way to use this package is through its Facades
Generating a PDF from a view and returning it inline
You can chain all the methods available in the browsershot master library
Returning the PDF as a download
You can pass the custom file name and additional headers the response will have to the inline
and download
methods like
Persisting PDF to disk
If you would like to save the generated pdf file to your storage disk you can call the store
or storeAs
method
Screenshots
Screenshots are created the same way as PDFs just change the facade to Screenshot
Generating screenshots as JPG/JPEG
By default screenshots will be taken as PNG format if you would like to use JPG instead call the useJPG()
method