clippings / phantom-pdf
A Package for generating PDF files using PhantomJS
Installs: 87 565
Dependents: 0
Suggesters: 0
Security: 0
Stars: 4
Watchers: 9
Forks: 26
pkg:composer/clippings/phantom-pdf
Requires
- php: ^7.1
- symfony/process: ^2.2 || ^3 || ^4
Requires (Dev)
- phpunit/phpunit: ^7
README
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