Download the PHP package oasys/chrome-pdf without Composer
On this page you can find all versions of the php package oasys/chrome-pdf. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download oasys/chrome-pdf
More information about oasys/chrome-pdf
Files in oasys/chrome-pdf
Package chrome-pdf
Short Description Minimal Chrome/Chromium PHP wrapper for generating PDF files from HTML using headless mode
License MIT
Informations about the package chrome-pdf
Oasys Chrome PDF
Minimal Chrome/Chromium PHP wrapper for generating PDF files from HTML using headless mode
- Save PDF to the filesystem
- Get PDF contents as base64
- Get PDF temporary file path
- Uses local Chrome/Chromium
- Configurable Chrome flags
Requirements
- PHP 8.2+
- Chrome or Chromium installed on the system
Installation
Quick start
Binary
By default, the package uses google-chrome
On systems using Chromium:
On Windows, pass the full executable path
Chrome flags
Additional Chrome flags can be passed through the constructor
Flags with true values are rendered as standalone flags
Standalone flags can also be passed as list values
Flags with scalar values are rendered as --key=value
Flags with array values are joined with commas
Flags with false or null values are skipped
The following Chrome flags are controlled internally and cannot be passed manually:
headlessprint-to-pdfno-pdf-header-footerprint-to-pdf-no-header
Output methods
Save to file
Base64
Temporary path
The caller is responsible for deleting the returned file
Print CSS
Use standard print CSS to control page layout
Design notes
- Chrome/Chromium must be installed separately
- HTML is written to a temporary
.htmlfile before rendering - Temporary HTML files are deleted automatically
- Temporary PDF files from
base64()are deleted automatically - Raw Chrome flags are also accepted, e.g.
flags: ['--no-sandbox'] - Header and footer generation is disabled