[ 
https://issues.apache.org/jira/browse/PDFBOX-3406?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Tilman Hausherr closed PDFBOX-3406.
-----------------------------------
    Resolution: Incomplete

closing due to lack of feedback.

> Problems setting "on values" for PDCheckBox
> -------------------------------------------
>
>                 Key: PDFBOX-3406
>                 URL: https://issues.apache.org/jira/browse/PDFBOX-3406
>             Project: PDFBox
>          Issue Type: Bug
>          Components: AcroForm
>    Affects Versions: 3.0.0
>            Reporter: Mark Melling
>
> I'm not entirely sure if this is a bug or I'm doing something incorrectly.
> I'm trying to create a PDCheckBox, which I can then subsequently call check() 
> on, but when I create a "vanilla" PDCheckBox and then call check() on it I 
> get the error:
> IllegalArgumentException value 'Yes' is not a valid option for the field 
> initial-assessment, valid values are: [] and Off
> I then tried to use setExportValues() as looking at the code it looked like 
> this would do the trick. Unfortunately checkValue() which is called at the 
> start of setValue() fails, as whilst the PDButton version of getOnValues 
> checks if their are any export values, the PDCheckBox version doesn't and for 
> this reason fails. 
> I then tried to create a dictionary of values by using setNormalAppearance on 
> the PDAppearanceDictionary of the CheckBox's widget. In the dictionary I just 
> created an entry using setName ("Yes", ""). Initially this didn't work as 
> getSubDirectory of PDAppearanceEntry filters out any entries that don't have 
> a value which is an instance of COSStream. I resolved this by simply creating 
> a empty COSStream value, but this didn't feel right, particularly given that 
> the value is not even used in this context (if I understand the code 
> correctly).
> Given all of this I suspect I'm doing this all wrong, but it's not clear what 
> the right way to do it is.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to