Skip to content

Conversation

@adrg
Copy link
Collaborator

@adrg adrg commented Jun 10, 2020

  • Fix combo field appearance not being displayed
  • Add support for array combo field options
  • Refactor filling combo and checkbox fields to adhere to the PDF specifications
  • Prevent panic when flattening forms using a nil appearance generator
  • Add fill test case covering text, combo and checkbox fields

Addresses #270

Partially addresses #341: both the fill and flatten operations work as intended. However, the PDF seems to be invalid the sense that the choice/combo field has an I array with a single value present, which causes the first value in the selection list to always be shown when opening the file. According to the specifications, the I field should be used only for fields that support multiple selection, which is not the case there. Setting that field to nil before the fill operation should solve the issue (the flatten operation works as intended using the PR, without removing the I value). See section 12.7.4.4 "Choice Fields" (pp. 444-446) of the PDF specs for more details.


This change is Reviewable

@codecov
Copy link

codecov bot commented Jun 10, 2020

Codecov Report

Merging #370 into development will decrease coverage by 0.00%.
The diff coverage is 58.82%.

Impacted file tree graph

@@               Coverage Diff               @@
##           development     #370      +/-   ##
===============================================
- Coverage        56.54%   56.54%   -0.01%     
===============================================
  Files              236      236              
  Lines            45786    45798      +12     
===============================================
+ Hits             25891    25895       +4     
- Misses           16555    16563       +8     
  Partials          3340     3340              
Impacted Files Coverage Δ
annotator/field_appearance.go 51.48% <0.00%> (-0.07%) ⬇️
model/flatten.go 64.22% <33.33%> (ø)
model/form.go 61.53% <76.00%> (-1.51%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 6cb58f6...542bf32. Read the comment docs.

Copy link
Contributor

@gunnsth gunnsth left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@gunnsth gunnsth merged commit 99ef1b8 into unidoc:development Jun 10, 2020
@adrg adrg deleted the combo-field-appearance branch June 10, 2020 16:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants