Download the PHP package jbreuer95/laravel-make-pdf without Composer

On this page you can find all versions of the php package jbreuer95/laravel-make-pdf. 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-make-pdf

Convert HTML to PDF with headless Chrome

Latest Version on Packagist Total Downloads GitHub Tests Action Status GitHub PHPStan Action Status GitHub Pint Action Status

This package allows you to easily convert HTML to PDF using headless Chrome through Selenium, without needing Node.js. It is inspired by Spatie's laravel-pdf package, which uses BrowserShot and Puppeteer, but our solution offers a more PHP-centric approach using Selenium.

Requirements

Laravel Make PDF requires PHP 8.1+ and Laravel 10+.

Installation & Setup

You can install the package via Composer:

After installation, download headless Chrome using the following Artisan command:

To customize the package configuration, publish the configuration file:

Here is the content of the published config file:

Usage

Converting HTML to PDF with this package is simple and efficient. Below are a few common use cases:

Basic Example

Convert a Blade view to a PDF and stream it to the browser:

Or force the browser to download the PDF file

Options

Render Raw HTML:

Instead of passing a Blade view, you can directly pass HTML:

Header and Footer

You can include a view in the header and footer of every page:

Alternatively, set raw HTML for the header and footer:

In the header or footer, the following placeholders can be used and will be replaced with their print-specific values:

Note: The header and footer do not inherit the same CSS as the main content, and the default font size is 0. You should include any required CSS directly in the header/footer. Here’s an example of a styled footer view:

Landscape Orientation

Switch the page orientation to landscape:

Set Paper Format

Specify a standard paper format:

The following formats are available: LETTER, LEGAL, A0, A1, A2, A3, A4, A5, A6.

Set Custom Paper Size

Set a custom paper size, specifying height and width in inches (or another unit):

Set Margins

Set custom margins for the PDF document:

Custom Filename

Define a custom name for the PDF when downloading from the browser. The .pdf extension is automatically appended if omitted:

Save to File

Use the save method to store the PDF at a given file path:

Retrieve PDF as a String

To obtain the raw PDF content as a string, use the raw method:

Stream PDF

Display the PDF directly in the browser without saving it to disk:

Force Download

Prompt the browser to immediately download the PDF:

License

This package is open-sourced software licensed under the MIT License.
Please see the License File for more information.


All versions of laravel-make-pdf with dependencies

PHP Build Version
Package Version
Requires php Version ^8.1
ext-zip Version *
guzzlehttp/guzzle Version ^7.9
illuminate/contracts Version ^10.0||^11.0
php-webdriver/webdriver Version ^1.15
spatie/laravel-package-tools Version ^1.16
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 jbreuer95/laravel-make-pdf contains the following files

Loading the files please wait ....