1. Go to this page and download the library: Download eureka2/acroforms 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/ */
eureka2 / acroforms example snippets
croforms\AcroForm;
$fields = [
'text' => [ // text fields
'text_field1' => 'value of text_field1',
'text_field2' => 'value of text_field2',
......
],
'button' => [ // button fields
'radio1' => 'value of radio1',
'checkbox1' => 'value of checkbox1',
........
]
];
$pdf = new AcroForm('exemple.pdf', [
'pdftk' => '/absolute/path/to/pdftk'
]);
$pdf->load($fields)->merge();
if (php_sapi_name() == 'cli') {
file_put_contents("filled.pdf", $pdf->output('S'));
} else {
$pdf->output('I', 'filled.pdf');
}