clippings / phantom-pdf by hkdobrev
forked from danielboendergaard/phantom-pdf

A Package for generating PDF files using PhantomJS
87,562
4
10
Package Data
Maintainer Username: hkdobrev
Maintainer Contact: danielboendergaard@gmail.com (Daniel Bøndergaard)
Package Create Date: 2015-11-06
Package Last Update: 2020-02-11
Language: PHP
License: MIT
Last Refreshed: 2024-04-17 15:12:36
Package Statistics
Total Downloads: 87,562
Monthly Downloads: 0
Daily Downloads: 0
Total Stars: 4
Total Watchers: 10
Total Forks: 0
Total Open Issues: 0

Phantom PDF

Build Status Scrutinizer Code Quality Code Coverage Latest Stable Version

Installation

Install via composer

$ composer global require clippings/phantom-pdf

Usage

$pdf = new PdfGenerator();

// Set a writable path for temporary files
$pdf->setStoragePath('storage/path');

// Saves the PDF as a file
$pdf->saveFromView($html, 'filename.pdf');

Use setBinaryPath('path') to use another version of PhantomJS.

Customizing the conversion script

If you want to use another script to execute with PhantomJS, this it how you do it.

$pdf->useScript('path/to/script');

return $pdf->saveFromView('view');

Credits

Forked from the great https://github.com/danielboendergaard/phantom-pdf package

Copyright (c) 2015, Clippings Ltd. Refactored by Ivan Kerin as part of clippings.com