Search code examples
phppdftk

Possible to join pdf-forms, fill and use passthrough in one command (PDFTK and PHP)?


I use pdftk successfully to fill a pdfform in PHP with the following code:

passthru( '/usr/bin/pdftk /mallpdf/1.pdf fill_form '.$tmpfname.' output - ');

Now I have two pdfforms which I would like to join and then fill with data.

Tried the code below but no success, any thoughts? Or perhaps not possible?

passthru( '/usr/bin/pdftk /mallpdf/1.pdf /mallpdf/2.pdf cat fill_form '.$tmpfname.' output - flatten');

Solution

  • You cannot do two operations at once with a single call to pdftk. Fill each of the forms with a separate call, then merge them together with a third call.