| 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: | 2025-11-17 15:08:54 |
| Package Statistics | |
|---|---|
| Total Downloads: | 87,565 |
| Monthly Downloads: | 0 |
| Daily Downloads: | 0 |
| Total Stars: | 4 |
| Total Watchers: | 9 |
| Total Forks: | 0 |
| Total Open Issues: | 0 |
Install via composer
$ composer global require clippings/phantom-pdf
$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.
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');
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