PHP PDF form filling using FPDM gives error Filter

2019-09-16 13:56发布

问题:

I am trying to make PHP script to autofill PDF forms using FPDM, but when I fix one bug, another one pops up. I found out my form fields using this tool and made an array where each variable is named after the field name, but I get an error

FilterFlateDecode: invalid stream data.

The form that I am trying to fill has radio fields which have the same name, eg.

C R6.  
C R6.  
C R6.  
C R6.

And I can't set 4 array fields to have the same name. Is that causing the problem? and if yes, how can I fix it? Should I just switch to a different library? Because this one is giving me a headache...

That is the FilterFlate file where the bug occurs (line 34) http://pastebin.com/qiEB9BWs

回答1:

You can't have the same name for more than one point of data. Each of those radio button options should fall into a specific group of them for example:

How was your day?

  • Good
  • Fair
  • Poor
  • N/A

The question would be the title of the input field, and each point would represent the data of that field.

If its just a checklist, then simply name each button as a separate radio input field.