AcroFields { public String[] getListOptionDisplay(String fieldName) { return getListOption(fieldName, 1); } AcroFields(PdfReader reader, PdfWriter writer); static Object[] splitDAelements(String da); String[] getAppearanceStates(String fieldName); String[] getListOptionExport(String fieldName); String[] getListOptionDisplay(String fieldName); boolean setListOption(String fieldName, String[] exportValues, String[] displayValues); int getFieldType(String fieldName); void exportAsFdf(FdfWriter writer); boolean renameField(String oldName, String newName); void decodeGenericDictionary(PdfDictionary merged, BaseField tx); String getFieldRichValue(String name); String getField(String name); String[] getListSelection(String name); boolean setFieldProperty(String field, String name, Object value, int inst[]); boolean setFieldProperty(String field, String name, int value, int inst[]); void mergeXfaData(Node n); void setFields(FdfReader fdf); boolean regenerateField(String name); boolean setField(String name, String value); boolean setField(String name, String value, boolean saveAppearance); boolean setFieldRichValue(String name, String richValue); boolean setField(String name, String value, String display); boolean setField(String name, String value, String display, boolean saveAppearance); boolean setListSelection(String name, String[] value); Map<String, Item> getFields(); void setFields(XfdfReader xfdf); Item getFieldItem(String name); String getTranslatedFieldName(String name); List<FieldPosition> getFieldPositions(String name); boolean removeFieldsFromPage(int page); boolean removeField(String name, int page); boolean removeField(String name); boolean isGenerateAppearances(); void setGenerateAppearances(boolean generateAppearances); boolean clearSignatureField(String name); ArrayList<String> getSignatureNames(); ArrayList<String> getBlankSignatureNames(); PdfDictionary getSignatureDictionary(String name); PdfIndirectReference getNormalAppearance(String name); boolean signatureCoversWholeDocument(String name); PdfPKCS7 verifySignature(String name); PdfPKCS7 verifySignature(String name, String provider); int getTotalRevisions(); int getRevision(String field); InputStream extractRevision(String field); Map<String, TextField> getFieldCache(); void setFieldCache(Map<String, TextField> fieldCache); void setExtraMargin(float extraMarginLeft, float extraMarginTop); void addSubstitutionFont(BaseFont font); ArrayList<BaseFont> getSubstitutionFonts(); void setSubstitutionFonts(ArrayList<BaseFont> substitutionFonts); XfaForm getXfa(); void removeXfa(); PushbuttonField getNewPushbuttonFromField(String field); PushbuttonField getNewPushbuttonFromField(String field, int order); boolean replacePushbuttonField(String field, PdfFormField button); boolean replacePushbuttonField(String field, PdfFormField button, int order); boolean doesSignatureFieldExist(String name); static final int DA_FONT; static final int DA_SIZE; static final int DA_COLOR; static final int FIELD_TYPE_NONE; static final int FIELD_TYPE_PUSHBUTTON; static final int FIELD_TYPE_CHECKBOX; static final int FIELD_TYPE_RADIOBUTTON; static final int FIELD_TYPE_TEXT; static final int FIELD_TYPE_LIST; static final int FIELD_TYPE_COMBO; static final int FIELD_TYPE_SIGNATURE; }
@Test public void testComboboxDisplayValues() { try { PdfReader reader = new PdfReader(PDF_COMBO); AcroFields acroFields = reader.getAcroFields(); String[] actual = acroFields.getListOptionDisplay(PDF_COMBO_FIELD_NAME); Assert.assertEquals(PDF_COMBO_VALUES.length, actual.length); for (int i = 0; i < PDF_COMBO_VALUES.length; i++) { Assert.assertEquals(PDF_COMBO_VALUES[i], actual[i]); } } catch (IOException e) { Assert.fail(e.getMessage()); } }