1

I've been tasked to fill a pre-made PDF form via a Symfony app. I'm using this pdftk wrapper to do the job, but there's an issue.

This PDF uses some scripts for hiding/showing some field: for example, they trigger when a radio button has been selected. When i fill the form with pdftk, the radio fields are changed correctly, but those scripts aren't executed, since those fields haven't been interacted by a human, i'm guessing.

I've already tried the flatten and need_appearances options to try to force their execution, but with no avail.

Is there a way to trigger these events from pdftk, or showing/hiding manually those fields, or there's an alternative to pdftk that does the trick? Keep in mind, i can't edit in any way the PDF, since it's an official document (in case you need it, this is the PDF)

Thank you!

Elsifo
  • 31
  • 3
  • Pdftk will not run any scripts, but it might be possible to do it manually. Which field attributes do the scripts modify? – notautogenerated Mar 06 '20 at 13:20
  • Also, what happens when you open the form with a viewer that does not support JavaScript? If it works in that case, a solution might be to strip all JavaScript away from your PDF before/after filling it. – notautogenerated Mar 06 '20 at 17:00

0 Answers0