You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Kernel forms: a choice field is written with a value that is not one of its options #775
ISO 32000-1, 12.7.4.4: when one item is selected, "V is a text string representing the name of the selected item, as given in the field dictionary's Opt array"; the default is null, "no item is currently selected". The Edit flag, the one case where V may be a typed value, is not set by the library.
Measured on origin/main b2791ba, no claim, Save of:
call
written
AddChoiceField(page, "c", rect, ["x", "y"], "q")
/Opt [(x) (y)] /V (q)
AddChoiceField(page, "c", rect, [], null)
/Opt [] /V ()
Both save. BuildChoiceField takes the selected value as given, or the first option, or the empty string (AcroFormBuilder.cs), and the appearance draws it.
Sweep: AddChoiceField is the only writer of Opt and of a choice V; the other seven packages write no choice field.
Proposal
Refuse a selected value that is not one of options, at the call, with ArgumentException (ParamNameselected), and write no V when there is no option to select (the default null). The 2.3.3 file was invalid, so the refusal is allowed. Document it on AddChoiceField.
Acceptance
The skipped test ConformanceAuditG6Tests.Iso32000_1_12_7_4_4_AChoiceValueIsAnItemOfTheOptionArrayOrAbsent runs and passes, and the pin Iso32000_1_12_7_4_4_PinsTodayAChoiceValueThatIsNotAnOptionIsWritten is replaced.
A choice field whose selected is an option, or null with options present, keeps its bytes.
Activity