PDChoiceField's implementation of SetValue does not work for all PDF forms.
Sometimes it throws ClassCastException
------------------------------------------------------------------------------------------------------------------
Key: PDFBOX-786
URL: https://issues.apache.org/jira/browse/PDFBOX-786
Project: PDFBox
Issue Type: Bug
Components: PDModel
Affects Versions: 1.2.1
Environment: Java6/MacosX
Reporter: Yonas Jongkind
Attachments: PDChoiceField.java, screenshot-1.jpg
For a choice with the following options:
COSArray{[COSString{ }, COSArray{[COSString{NR}, COSString{Non-reactive}]},
COSArray{[COSString{R}, COSString{Reactive}]}, COSArray{[COSString{Declined},
COSString{Declined}]}]}
A class cast is thrown as the code expects all items to be strings as the first
item is a string. However, the remaining items are all pairs.
The attached code is the fix. It just makes the pair/single check every time
through the loop.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.