PHP wrapper for PDFtk.
Inspired by Kevsoft.PDFtk and pypdftk.
To install, use composer:
composer require qdequippe/phpdftk
- PDFtk Server installed (see below installation based on your OS)
See https://doc.ubuntu-fr.org/pdftk (similar on other distributions).
apt-get install pdftk
brew install pdftk-java
For example, to fill input PDF’s form fields with the data from an FDF file or XFDF file.
$pdftk = new \Qdequippe\PHPDFtk\Pdftk();
$filledPdf = $pdftk->fillForm(
pdfFilePath: 'path_to_pdf.pdf',
formDataFilePath: 'path_to_form_data.fdf', // or XFDF file,
flatten: true,
);
// $filledPdf = PDF filled with form data
./vendor/bin/phpunit
The MIT License (MIT). Please see License File for more information.