AcroFields.Item item = acroFields.getFieldItem(fldName);
PdfDictionary valueDict = item.getValue(0);
PdfDictionary appearanceDict = valueDict .getAsDict(PdfName.AP);
if (appearanceDict != null) {
PdfDictionary normalAppearances = appearanceDict.getAsDict(PdfName.N);
// /D is for the "down" appearances.
// if there are normal appearances, one key will be "Off", and the other
// will be the export value... there should only be two.
if (normalAppearances != null) {
Set<PdfName> keys = normalAppearances .getKeys();
for (PdfName curKey : keys) {
if (!PdfName.OFF.equals(curKey)) {
return curKey.toString(); // string will have a leading '/' character
}
}
}
}
// if that doesn't work, there might be an /AS key, whose value is a name with
// the export value, again with a leading '/'
PdfName curVal = valueDict.getAsName(PdfName.AS);
if (curVal != null) {
return curVal.toString();
}
Get the export value of a checkbox using iTextSharp