1. Go to this page and download the library: Download vielhuber/pdfexport 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/ */
$pdf = new pdfexport;
// add a static pdf
$pdf->add('tests/file.pdf');
// add a static pdf and fill out the form
$pdf->add('tests/file.pdf')
->data([
'placeholder1' => 'foo',
'placeholder2' => 'bar'
]);
// add multiple portions of data
$pdf->add('tests/file.pdf')
->data([
'placeholder1' => 'This is a test',
'placeholder2' => 'This is a multiline\ntest1\ntest2\ntest3\ntest4\ntest5\ntest6\ntest7\ntest8\ntest9\ntest10'
])
->data([
'placeholder3' => 'This is Sonderzeichen ß täst!'
]);
// form fields
$pdf->getFormFields('tests/file.pdf'); // [ ['name' => 'field_name_1', 'type' => 'Text'], ... ]
$pdf->hasFormField('tests/file.pdf', 'field_name_1') // true
// do the same but grayscale the page
$pdf->add('tests/file.pdf')
->grayscale();
// grayscale (not vector) with a resolution of 80%
$pdf->add('tests/file.pdf')
->grayscale(80);
// add a html file
$pdf->add('tests/file.html');
// add a html file in a3, landscape
$pdf->add('tests/file.html')
->format('a3','landscape');
// add a html file and replace placeholders ( echo $data->placeholder;
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.