close
The Wayback Machine - https://web.archive.org/web/20201020111804/https://github.com/SynergiTech/chrome-pdf-php
Skip to content
master
Go to file
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
src
 
 
 
 
 
 
 
 
 
 
 
 
 
 

README.md

PHP ChromePDF Renderer

Unit tests Build Status codecov

For pre-V1 documentation click here

This is a library for creating PDFs from HTML rendered with the SkPDF backend via Chrome. In order to do this, you can opt to use one of the supported drivers:

Installation

composer require synergitech/chrome-pdf-php

chrome-pdf

If you are planning to use the chrome-pdf driver to render PDFs locally, you should also make sure to install this from npm.

browserless

If you are planning to use the browserless driver to render PDFs remotely, you should register for an API key. Remember that local assets cannot be rendered by browserless.

Usage

A common interface is provided via AbstractPDF. The options presented via this class will be available from all drivers.

You should instantiate one of the available drivers, potentially passing options required by the driver:

use SynergiTech\ChromePDF\Chrome;
use SynergiTech\ChromePDF\Browserless;

$pdf = new Chrome('path-to-chrome-pdf');
$pdf->renderContent('<h1>test</h1>');

$pdf = new Browserless('your-api-key');
$pdf->renderContent('<h1>test</h1>');

Examples

Some examples can be found in the examples folder.

About

PHP library to render PDFs in Chrome via chrome-pdf or Browserless

Topics

Resources

License

Packages

No packages published

Languages

You can’t perform that action at this time.