value of selected checkbox is "Off"
"Thomas Harre" <[email protected]> Mon, 09 Feb 2015 14:11:31 +0100
| Newsgroups | gmane.comp.java.lib.itext.general |
|---|---|
| Message-ID | <[email protected]> |
Hi Eveybody
I've got a PDF with 3 Checkboxes.
One of these Checkboxes is selected, as can be seen in the attached PDF
and in the attached screenshot.
When I analyse the pdf file with following code i get this result:
for (Map.Entry<String, AcroFields.Item> entry :
acroFields.getFields().entrySet()) {
String fieldName = entry.getKey();
String value = acroFields.getField(fieldName);
if (acroFields.getFieldType(fieldName) ==
AcroFields.FIELD_TYPE_CHECKBOX) {
String[] appearanceStates =
acroFields.getAppearanceStates(fieldName);
System.out.println("Checkbox: " + fieldName + " Value:" + value
+
" AvailableValues:" + StringUtil.concatWithDelimiter(",",
appearanceStates));
}
}
Result:
Checkbox: CheckBox_Group1 Value:Off AvailableValues:chk1,Off
Checkbox: CheckBox_Group2 Value:Off AvailableValues:chk2,Off
Checkbox: CheckBox_Group3 Value:Off AvailableValues:Off,chk3
So all of the values are "Off".
Is there something wrong with my pdf file or have I completely
misunderstood something?
Thanks for your help and kind regards
Thomas
------------------------------------------------------------------------------
Dive into the World of Parallel Programming. The Go Parallel Website,
sponsored by Intel and developed in partnership with Slashdot Media, is your
hub for all things parallel software development, from weekly thought
leadership blogs to news, videos, case studies, tutorials and more. Take a
look and join the conversation now. http://goparallel.sourceforge.net/
_______________________________________________
iText-questions mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/itext-questions
iText(R) is a registered trademark of 1T3XT BVBA.
Many questions posted to this list can (and will) be answered with a reference to the iText book: http://www.itextpdf.com/book/
Please check the keywords list before you ask for examples: http://itextpdf.com/themes/keywords.php
DemoCheckBoxRadio.pdf
(application/pdf, 52.8 KB) - not displayed
screenshot.png
(image/png, 87.4 KB) - not displayed