PHP code example of clippings / phantom-pdf
1. Go to this page and download the library: Download clippings/phantom-pdf library. Choose the download type require. 2. Extract the ZIP file and open the index.php. 3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
clippings / phantom-pdf example snippets
$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');
$pdf->useScript('path/to/script');
return $pdf->saveFromView('view');
$ composer global