PDFTK on plesk (centos) – Stack Overflow
I’m trying to use PDFTK on a php page hosted on a PLESK server (Centos) but I have an error…
PDFTK was successfully installed with composer
If I use :
$pdf = new Pdf('form.pdf');
$result = $pdf->fillForm([
'name'=>'test name',
'email' => 'test email',
])
->needAppearances()
->saveAs('form_filled.pdf');
I have this error:
sh: pdftk: command not found
I think I found an idea in the documentation :
With Plesk (onCentos), I think you need to indicate the full path of pdftk, but I don’t know how to find it…
$pdf = new Pdf('/path/my.pdf', [
'command' => '/some/other/path/to/pdftk',
// or on most Windows systems:
// 'command' => 'C:\Program Files (x86)\PDFtk\bin\pdftk.exe',
'useExec' => true, // May help on Windows systems if execution fails
]);
Could someone help me or have another idea… Thank you
Read more here: Source link
