unidoc / unipdf

Golang PDF library for creating and processing PDF files (pure go)
https://unidoc.io
Other
2.59k stars 253 forks source link

[BUG] Subforms show up as non-fillable fields #326

Closed tmlbl closed 4 years ago

tmlbl commented 4 years ago

Description

Some fillable PDFs have a concept of "subforms". When UniPDF parses these, the subforms themselves show up as fields, and the individual fields within the subforms do not appear in the fields list.

Expected Behavior

Subform fields show up as fillable fields in .Acroform.AllFields() and are fillable with the JSON filling functions

Actual Behavior

Steps to reproduce the behavior:

  1. Build the form filler example: https://github.com/unidoc/unipdf-examples/blob/master/forms/pdf_form_fill_json.go
  2. Dump the field information from the IRS 1040 form (attached) to file:
    go run pdf_form_fill_json.go 1040.pdf > formdata.json
  3. View formdata.json. The fields available to fill are top-level definitions for the subforms, the fields within the subforms are not visible.

Attachments

1040.pdf

github-actions[bot] commented 4 years ago

Welcome! Thanks for posting your first issue. The way things work here is that while customer issues are prioritized, other issues go into our backlog where they are assessed and fitted into the roadmap when suitable. If you need to get this done, consider buying a license which also enables you to use it in your commercial products. More information can be found on https://unidoc.io/

gunnsth commented 4 years ago

@tmlbl Thanks for reporting the problem. PR #328 addresses those issues. It has been merged into development branch. Can you try it out?

tmlbl commented 4 years ago

Hi @gunnsth, we are seeing fields for subforms showing up now. Thank you for the quick fix! When do you think this can be included in a tagged release?

gunnsth commented 4 years ago

Will be part of new release early next week.