@Override void constructAppearances() throws IOException { AppearanceGeneratorHelper apHelper; apHelper = new AppearanceGeneratorHelper(this); apHelper.setAppearanceValue(getValue()); } }
private FieldIterator(PDAcroForm form) { List<PDField> fields = form.getFields(); for (PDField field : fields) { enqueueKids(field); } }
/** * Constructs a COSAppearance from the given field. * * @param field the field which you wish to control the appearance of * @throws IOException */ AppearanceGeneratorHelper(PDVariableText field) throws IOException { this.field = field; validateAndEnsureAcroFormResources(); this.defaultAppearance = field.getDefaultAppearanceString(); }
/** * Get the default appearance. * * This is an inheritable attribute. * * The default appearance contains a set of default graphics and text operators * to define the field’s text size and color. * * @return the DA element of the dictionary object */ PDDefaultAppearanceString getDefaultAppearanceString() throws IOException { COSString da = (COSString) getInheritableAttribute(COSName.DA); PDResources dr = getAcroForm().getDefaultResources(); return new PDDefaultAppearanceString(da, dr); }
/** * Get the fields rich text value. * * @return the rich text value string */ public String getRichTextValue() { return getStringOrStream(getInheritableAttribute(COSName.RV)); }
public static TextAlign valueOf(int alignment) { for (TextAlign textAlignment : TextAlign.values()) { if (textAlignment.getTextAlign() == alignment) { return textAlignment; } } return TextAlign.LEFT; } }
/** * Returns an iterator which walks all fields in the field tree, in order. */ public Iterator<PDField> getFieldIterator() { return new PDFieldTree(this).iterator(); }
/** * Returns the value of this field, or an empty string. * * @return A non-null string. */ public String getValue() { return getStringOrStream(getInheritableAttribute(COSName.V)); }
/** * Checks the check box. * * @throws IOException if the appearance couldn't be generated. */ public void check() throws IOException { setValue(getOnValue()); }
@Override void constructAppearances() throws IOException { AppearanceGeneratorHelper apHelper; apHelper = new AppearanceGeneratorHelper(this); apHelper.setAppearanceValue(""); } }
/** * @see PDField#PDField(PDAcroForm) * * @param acroForm The acroform. */ public PDComboBox(PDAcroForm acroForm) { super(acroForm); setCombo(true); }
/** * Returns the default values, or an empty List. This list always contains a single item * unless {@link #isMultiSelect()} is true. * * @return A non-null string. */ public List<String> getDefaultValue() { return getValueFor(COSName.DV); }
/** * Creates a COSField subclass from the given COS field. This is for reading fields from PDFs. * * @param form the form that the field is part of * @param field the dictionary representing a field element * @param parent the parent node of the node to be created, or null if root. * @return a new PDField instance */ static PDField fromDictionary(PDAcroForm form, COSDictionary field, PDNonTerminalField parent) { return PDFieldFactory.createField(form, field, parent); }
/** * Test for dynamic XFA content. * * @param acroForm the AcroForm * @return true if there is a dynamic XFA form. */ private boolean isDynamicXfa(PDAcroForm acroForm) { return acroForm != null && acroForm.xfaIsDynamic(); }
PlainTextFormatter build() { return new PlainTextFormatter(this); } }
/** * Constructor. Side effect: /Helv and /ZaDb fonts added with update mark. * * @param doc The document that this form is part of. * @param form The existing acroForm. */ public PDAcroForm(PDDocument doc, COSDictionary form) { document = doc; dictionary = form; verifyOrCreateDefaults(); }
@Override public String getValueAsString() { return getValue(); }
/** * Return the field tree representing all form fields */ public PDFieldTree getFieldTree() { return new PDFieldTree(this); }
/** * Returns an iterator which walks all fields in the tree, in order. */ @Override public Iterator<PDField> iterator() { return new FieldIterator(acroForm); }
/** * Returns the selected values, or an empty List. This list always contains a single item * unless {@link #isMultiSelect()} is true. * * @return A non-null string. */ public List<String> getValue() { return getValueFor(COSName.V); }