Maruan Sahyoun created PDFBOX-6207:
--------------------------------------
Summary: Setting checkbox value fails when field has an invalid
/Opt entry
Key: PDFBOX-6207
URL: https://issues.apache.org/jira/browse/PDFBOX-6207
Project: PDFBox
Issue Type: Improvement
Components: AcroForm
Affects Versions: 3.0.7 PDFBox, 2.0.36, 4.0.0
Reporter: Maruan Sahyoun
Assignee: Maruan Sahyoun
from the users mailing list:
SUMMARY
When a checkbox field in an AcroForm PDF contains an empty /Opt array (/Opt [])
in its field dictionary, calling PDCheckBox.setValue("Yes") throws an
IllegalArgumentException, even though "Yes" is a perfectly valid export value
defined by the field's appearance states.
The same field can be checked and unchecked without any error using Adobe
Acrobat products (Acrobat Reader, Acrobat Pro), which treat the empty /Opt
array as if it were absent. This confirms that the PDF is valid and the issue
is specific to PDFBox's validation logic.
ERROR MESSAGE
java.lang.IllegalArgumentException: value 'Yes' is not a valid option for the
field Check_Info_Post_andere, valid values are: [] and Off
--
This message was sent by Atlassian Jira
(v8.20.10#820010)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]