PDF form with multiple pages and same field names #1948
-
Hello everyone! I have a PDF with multiple pages. They are all basically the same and only have minor differences. My client wants to offer some specific forms for the users that they need in multiple versions. Like a sick note: One is for the employer, one for the insurance and one for the user himself. As all pages/forms share the same basic information I've used the same form field names multiple times. For example the fields for the user name are "userFirstname" and "userLastName" on all pages. What my application does is the following:
For the 1st page everything works great. The data is rendered in the form and I can see them in the print-preview. But on the other pages which use the same form field names I don't see any rendered data. So my question is: Is the PDF Viewer able to render a formData into multiple form fields with the same name? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Phew, that's difficult. I don't want to go into this rabbit-hole. I understand the use-case, but I'm afraid implementing your feature breaks other developers' applications. Plus, implementing My recommendation is to modify the PDF document so that the field names are unique. If that's not an option, you can analyze the DOM. The PDF viewer renders editable form fields as |
Beta Was this translation helpful? Give feedback.
Phew, that's difficult. I don't want to go into this rabbit-hole. I understand the use-case, but I'm afraid implementing your feature breaks other developers' applications. Plus, implementing
[(formData)]
wasn't easy, so I don't want to add additional complexity.My recommendation is to modify the PDF document so that the field names are unique.
If that's not an option, you can analyze the DOM. The PDF viewer renders editable form fields as
<input>
fields. The field names and ids tend to be cryptic, but I believe they are derived from the field names in the PDF field, so I guess you can fix this when creating the PDF file. Once you've got the field, you can insert the text programmaticall…