Gnostice PDFOne
Pro. Ed. v5.0.0


com.gnostice.pdfone
Class PdfFormField

java.lang.Object
  extended bycom.gnostice.pdfone.PdfAnnot
      extended bycom.gnostice.pdfone.PdfProAnnot
          extended bycom.gnostice.pdfone.PdfFormField
All Implemented Interfaces:
Cloneable, Usable
Direct Known Subclasses:
com.gnostice.pdfone.PdfFormButtonField, com.gnostice.pdfone.PdfFormChoiceField, PdfFormSignatureField, PdfFormTextField

public class PdfFormField
extends com.gnostice.pdfone.PdfProAnnot

This is a base class from which all form field classes are derived. In document creation mode, a form field can be added to a page by calling the method PdfPage.addFormField(PdfFormField). In document reading mode, a list of form fields in a page can be obtained by calling the method PdfPage.getAllFormFields().

A form field is identified in the document by its "name." However, an optional "mapping name" can be specified for the form field so that:

An optional "alternate name" can be specified. This name will be used:

All these names can be specified in overloaded constructors of this class and its sub classes.

PdfWriter writer1 = PdfWriter.fileWriter(
           new File("PdfFormField_example.pdf"));
PdfDocument doc1 = new PdfDocument(writer1);

doc1.setOverrideFieldAppearanceStreams(true);

// Create a PDF page
PdfPage page = new PdfPage();

// Create a text box form field
PdfFormField ff1 = new PdfFormTextField(
                         new PdfRect(300, 100, 100, 20),
                         "tf_name");
ff1.setBorderColor(Color.BLACK);
ff1.setValue("Enter name here");
ff1.setNameAsUnicode(false);

PdfFormField ff2 = new PdfFormPushButton(
                         new PdfRect(300, 130, 35, 20),
                         "pb_submit",
                         " Submit ");

// Create a push button form field
ff2.setBorderStyle(PdfAnnot.BORDERSTYLE_BEVELED);
ff2.setBorderColor(Color.GRAY);
ff2.setBackgroundColor(Color.LIGHT_GRAY);
ff2.addActionFormSubmit(
        PdfEvent.ON_MOUSE_DOWN, 
        "http://www.gnostice.com/newsletters/demos/200804/forms_test.asp");
ff2.setNameAsUnicode(false);

// Add the form field to the page
page.addFormField(ff1);
page.addFormField(ff2);

page.writeText("Enter name", 225, 105);

doc1.add(page);
doc1.setOpenAfterSave(true);
doc1.write();
writer1.dispose();      


Field Summary
static int ALIGNMENT_CENTER
          Constant for aligning text inside a form field to both left and right.
static int ALIGNMENT_LEFT
          Constant for aligning text inside a form field to left.
static int ALIGNMENT_RIGHT
          Constant for aligning text inside a form field to right.
static int BUTTON_STATE_OFF
          Constant for specifying that a radio button/check box is not selected.
static int BUTTON_STATE_ON
          Constant for specifying that a radio button/check box is selected.
static int FLAG_CHOICE_COMMIT_ON_SEL_CHANGE
          A flag indicating that actions associated with the list box or combo box form field are executed immediately when an option is selected.
static int FLAG_CHOICE_MULTISELECT
          A flag indicating that multiple options in a combo box/list box can be selected.
static int FLAG_NO_EXPORT
          A flag indicating that the form field will not be submitted when the form is submitted.
static int FLAG_NO_SPELLCHECK
          A flag indicating that text option entered by the user in the combo box is not spell-checked.
static int FLAG_NONE
          A flag indicating that no other has been set and that the field simply inherits the flags of the parent form field.
static int FLAG_RADIO_IN_UNISON
          A flag indicating that the radio button can be selected or deselected in unison with other radio buttons in its group.
static int FLAG_RADIO_NO_TOGGLE_TO_OFF
          A flag indicating that the radio button or another one in its group will remain selected at any time.
static int FLAG_READONLY
          A flag indicating that the form field's properties cannot be changed by the user.
static int FLAG_REQUIRED
          A flag indicating that the form field needs to have a value when the form is submitted.
static int FLAG_SUBMIT_TYPE_FDF
           
static int HIGHLIGHT_MODE_INVERT
          Highlight mode for a form field that makes the contents inside its bounding box appear inverted.
static int HIGHLIGHT_MODE_NONE
          Highlight mode for a form field that makes it appear without any change from its normal appearance.
static int HIGHLIGHT_MODE_OUTLINE
          Highlight mode for a form field that makes the border of its bounding box appear inverted.
static int HIGHLIGHT_MODE_PUSH
          Highlight mode for a form field that makes it look as if it were pushed up from below the surface of the page.
static int HIGHLIGHT_MODE_TOGGLE
          Deprecated. Instead, use HIGHLIGHT_MODE_PUSH.
static int ROTATION_0
          Constant for rotation of a form field by 0 degrees.
static int ROTATION_180
          Constant for rotation of a form field by 180 degrees.
static int ROTATION_270
          Constant for rotation of a form field by 270 degrees.
static int ROTATION_90
          Constant for rotation of a form field by 90 degrees.
static int SUBMIT_ACTION_TYPE_FDF
           
static int SUBMIT_ACTION_TYPE_HTML_POST
           
static int SUBMIT_ACTION_TYPE_XFDF
           
static int TYPE_CHECKGROUP
          Constant specifying that a form field is a check box group.
static int TYPE_COMBOBOX
          Constant specifying that a form field is a combo box.
static int TYPE_LISTBOX
          Constant specifying that a form field is a list box.
static int TYPE_PUSHBUTTON
          Constant specifying that a form field is a push button.
static int TYPE_RADIOGROUP
          Constant specifying that a form field is a radio button group.
static int TYPE_SIGNATURE
           
static int TYPE_TEXTFIELD
          Constant specifying that a form field is a text field.
 
Fields inherited from class com.gnostice.pdfone.PdfAnnot
ANNOT_TYPE_CARET, ANNOT_TYPE_CIRCLE, ANNOT_TYPE_FILE_ATTACHMENT, ANNOT_TYPE_FREE_TEXT, ANNOT_TYPE_INK, ANNOT_TYPE_LINE, ANNOT_TYPE_LINK, ANNOT_TYPE_MARKUP, ANNOT_TYPE_POLYGON, ANNOT_TYPE_POLYLINE, ANNOT_TYPE_POPUP, ANNOT_TYPE_SQUARE, ANNOT_TYPE_STAMP, ANNOT_TYPE_TEXT, ANNOT_TYPE_WATERMARK, BORDERSTYLE_BEVELED, BORDERSTYLE_DASHED, BORDERSTYLE_INSET, BORDERSTYLE_SOLID, BORDERSTYLE_UNDERLINE, FLAG_HIDDEN, FLAG_INVISIBLE, FLAG_LOCKED, FLAG_NO_ROTATE, FLAG_NO_VIEW, FLAG_NO_ZOOM, FLAG_PRINT, FLAG_TOGGLE_NO_VIEW
 
Fields inherited from interface com.gnostice.pdfone.Usable
INCHES_TO_POINTS, MM_TO_INCHES, MM_TO_POINTS, PDF_A, PDF_AA, PDF_AC, PDF_ACROFORM, PDF_ACTION, PDF_ALTERNATEPRESENTATIONS, PDF_ANNOT, PDF_ANNOT_DEFAULT_TITLE, PDF_ANNOT_NAME, PDF_ANNOT_SUBJECT, PDF_ANNOTS, PDF_AP, PDF_ARRAYEND, PDF_ARRAYSTART, PDF_ARTBOX, PDF_AS, PDF_ASCENT, PDF_ASCII85, PDF_ASCII85_NEW, PDF_ASCIIHEX, PDF_ASCIIHEX_NEW, PDF_AuthEvent, PDF_AUTHOR, PDF_AVGWIDTH, PDF_B, PDF_BASEFONT, PDF_BBOX, PDF_BC, PDF_BE, PDF_BEFOREFORMAT, PDF_BEGINTEXT, PDF_BG, PDF_BINARYDATA, PDF_BITS_PER_COMPONENT, PDF_BL, PDF_BLEEDBOX, PDF_BLINDS, PDF_BMC, PDF_BORDER, PDF_BOX, PDF_BS, PDF_BTN, PDF_BYTERANGE, PDF_C, PDF_CA, PDF_CA_SMALL, PDF_CAPHEIGHT, PDF_CARETANNOT, PDF_CARRIAGE, PDF_CATALOG, PDF_CENTER_WINDOW, PDF_CF, PDF_CFM, PDF_CH, PDF_CID_TO_GID_MAP, PDF_CIDFONT_TYPE1, PDF_CIDFONT_TYPE2, PDF_CIDSYSTEM_INFO, PDF_CIRCLEANNOT, PDF_CL, PDF_CM, PDF_COLOMNS, PDF_COLOR, PDF_COLORSPACE, PDF_COLORSPACE_CALGRAY, PDF_COLORSPACE_CALRGB, PDF_COLORSPACE_DEVICEN, PDF_COLORSPACE_ICCBASED, PDF_COLORSPACE_LAB, PDF_COLORSPACE_SEPARATION, PDF_CONTACTINFO, PDF_CONTENTS, PDF_COUNT, PDF_COVER, PDF_CREATIONDATE, PDF_CREATOR, PDF_CROPBOX, PDF_CS, PDF_CSP, PDF_D, PDF_DA, PDF_DATE, PDF_DATE_FORMAT, PDF_DCTDECODE, PDF_DCTDECODE_NEW, PDF_DECODEPARMS, PDF_DESC, PDF_DESCENDANT, PDF_DESCENDANT_FONTS, PDF_DESCENDENTFONTS, PDF_DESCENT, PDF_DESTINATION, PDF_DESTS, PDF_DEVICE_CMYK, PDF_DEVICE_GRAY, PDF_DEVICE_RGB, PDF_DI, PDF_DICTEND, PDF_DICTSTART, PDF_DIFFERENCES, PDF_DIRECTION, PDF_DISPLAY_DOCTITLE, PDF_DISPLAY_DURATION, PDF_DISSOLVE, PDF_DM, PDF_DOC_SUBJECT, PDF_DOCMDP, PDF_DOS, PDF_DP, PDF_DR, PDF_DS, PDF_DV, PDF_DW, PDF_E, PDF_EF, PDF_EMBEDDEDFILE, PDF_EMBEDDEDFILES, PDF_EMC, PDF_ENCODING, PDF_ENCRYPT, PDF_ENCRYPTMETADATA, PDF_ENDOBJ, PDF_ENDPATH, PDF_ENDSTREAM, PDF_ENDTEXT, PDF_EOCLIP, PDF_EOF, PDF_EXTGSTATE, PDF_F, PDF_FADE, PDF_FALSE, PDF_FDESCRIPTOR, PDF_FIELD_FLAG, PDF_FIELDS, PDF_FILEATTACHMENTANNOT, PDF_FILESPEC, PDF_FILTER, PDF_FIRST, PDF_FIRST_PAGE, PDF_FIRSTCHAR, PDF_FIT, PDF_FIT_WINDOW, PDF_FITB, PDF_FITBH, PDF_FITBV, PDF_FITH, PDF_FITR, PDF_FITV, PDF_FIXEDPRINT, PDF_FLAGS, PDF_FLATE, PDF_FLATE_NEW, PDF_FLY, PDF_FO, PDF_FONT, PDF_FONTBBOX, PDF_FONTDESCRIPTOR, PDF_FONTFILE, PDF_FONTFILE_2, PDF_FontFile_3, PDF_FONTFILE2, PDF_FONTNAME, PDF_FONTNAMEPREFIX, PDF_FORM, PDF_FORMFEED, PDF_FORMFONTPREFIX, PDF_FREE_TEXT_CALLOUT, PDF_FREE_TEXT_TYPEWRITER, PDF_FREETEXTANNOT, PDF_FS, PDF_FT, PDF_FULLSCREEN, PDF_GLITTER, PDF_GOTO_ACTION, PDF_GROUP, PDF_GS, PDF_H, PDF_HEADER, PDF_HEIGHT, PDF_HEXSTRINGEND, PDF_HEXSTRINGSTART, PDF_HIDE_MENUBAR, PDF_HIDE_TOOLBAR, PDF_HIDE_WINDOWUI, PDF_HIGHLIGHT, PDF_HORIZ_STEM, PDF_HORIZONTAL, PDF_I, PDF_IC, PDF_ID, PDF_IDS, PDF_IF, PDF_IMAGE, PDF_IMAGEB, PDF_IMAGEC, PDF_IMAGEI, PDF_IMPORTDATA, PDF_INDEX, PDF_INDEXED, PDF_INFO, PDF_INK, PDF_INKLIST, PDF_INWARD, PDF_IT, PDF_ITALANGLE, PDF_IX, PDF_JAVASCRIPT, PDF_JAVASCRIPT_ACTION, PDF_JS, PDF_KEYSTROKE, PDF_KEYWORDS, PDF_KIDS, PDF_L, PDF_L2R, PDF_LANG, PDF_LAST, PDF_LAST_PAGE, PDF_LASTCHAR, PDF_LAUNCH_ACTION, PDF_LE, PDF_LEGAL, PDF_LENGTH, PDF_LENGTH_1, PDF_LENGTH_2, PDF_LENGTH_3, PDF_LF, PDF_LINEANNOT, PDF_LINKANNOT, PDF_LITERALSTRINGEND, PDF_LITERALSTRINGSTART, PDF_LOCATION, PDF_LZWDECODE, PDF_M, PDF_MAC, PDF_MARKINFO, PDF_MATRIX, PDF_MAXLEN, PDF_MAXWIDTH, PDF_MEDIABOX, PDF_METADATA, PDF_MISSINGWIDTH, PDF_MK, PDF_MODDATE, PDF_N, PDF_NAME, PDF_NAMED, PDF_NAMED_ACT_FIND, PDF_NAMED_ACT_OPEN, PDF_NAMED_ACT_PRINT, PDF_NAMED_ACT_SEARCH, PDF_NAMES, PDF_NAMESTART, PDF_NEEDAPPEARANCES, PDF_NEWLINE, PDF_NEWWINDOW, PDF_NEXT, PDF_NEXT_PAGE, PDF_NO_COMP_OBJ, PDF_NONFULLSCREEN_PAGEMODE, PDF_NULL, PDF_O, PDF_OBJ, PDF_OBJSTREAM, PDF_OCPROPERTIES, PDF_OFF, PDF_ONECOLUMN, PDF_OPEN, PDF_OPEN_ACTION, PDF_OPT, PDF_OUTLINES, PDF_OUTPUTINTENTS, PDF_OUTWARD, PDF_P, PDF_PAGE, PDF_PAGECLOSE, PDF_PAGEINVISIBLE, PDF_PAGELABELS, PDF_PAGELAYOUT, PDF_PAGEMODE, PDF_PAGEOPEN, PDF_PAGES, PDF_PAGEVISIBLE, PDF_PAINT_TYPE, PDF_PARAMS, PDF_PARENT, PDF_PATTERN, PDF_PATTERN_TYPE, PDF_PBD, PDF_PC, PDF_PDC, PDF_PDF, PDF_PERMS, PDF_PFD, PDF_PH, PDF_PIECEINFO, PDF_POLYGONANNOT, PDF_POLYLINEANNOT, PDF_POPUP, PDF_PREDICTOR, PDF_PREV, PDF_PREV_PAGE, PDF_PROCSET, PDF_PRODUCER, PDF_PROPERTIES, PDF_PUSH, PDF_PV, PDF_Q, PDF_QUADPOINTS, PDF_R, PDF_R2L, PDF_RC, PDF_RD, PDF_RE, PDF_REASON, PDF_RECALCULATE, PDF_RECT, PDF_REMOTEGOTO_ACTION, PDF_RENDITIONS, PDF_REPLACE, PDF_RESET_FORM, PDF_RESOURCES, PDF_RESTORE_GS, PDF_RI, PDF_ROOT, PDF_ROTATE, PDF_RUNLENGTH, PDF_RUNLENGTH_NEW, PDF_S, PDF_SCN, PDF_SHADING, PDF_SHOWIMG, PDF_SHOWTEXT, PDF_SHOWTEXT_TJ, PDF_SIG, PDF_SIG_FILTER_ADOBE_PPKLITE, PDF_SIG_FILTER_ADOBE_PPKMS, PDF_SIG_SUBFILTER_ADBE_PKCS7_DETACHED, PDF_SIG_SUBFILTER_ADBE_PKCS7_SHA1, PDF_SINGLE_QUOTES, PDF_SINGLEPAGE, PDF_SIZE, PDF_SP, PDF_SPIDERINFO, PDF_SPLIT, PDF_SQUAREANNOT, PDF_SQUIGGLY, PDF_SS, PDF_STAMPANNOT, PDF_STARTXREF, PDF_StmF, PDF_STORE_GS, PDF_STREAM, PDF_StrF, PDF_STRIKEOUT, PDF_STRUCT_TREE, PDF_SUBFILTER, PDF_SUBMIT_FORM, PDF_SUBTYPE, PDF_T, PDF_TAB, PDF_TEMPLATES, PDF_TEXT, PDF_TEXTANNOT, PDF_TEXTDIMENSION, PDF_TEXTFONT, PDF_TEXTLEAD, PDF_TEXTMATRIX, PDF_TEXTNEWLINESTART, PDF_TEXTRENDER, PDF_TEXTWIDTH, PDF_THREADS, PDF_THUMB, PDF_TILING_TYPE, PDF_TITLE, PDF_TJ_OPERAND_END, PDF_TJ_OPERAND_START, PDF_TM, PDF_TOUNICODE, PDF_TP, PDF_TRAILER, PDF_TRANSITION, PDF_TRIMBOX, PDF_TRUE, PDF_TRUETYPE, PDF_TU, PDF_TWOCOLUMN_LEFT, PDF_TWOCOLUMN_RIGHT, PDF_TWOPAGE_LEFT, PDF_TWOPAGE_RIGHT, PDF_TX, PDF_TYPE, PDF_TYPE0, PDF_TYPE1, PDF_U, PDF_UNCOVER, PDF_UNDERLINE, PDF_UNIX, PDF_URI_ACTION, PDF_URL, PDF_URLS, PDF_USEATTACHMENTS, PDF_USENONE, PDF_USEOC, PDF_USEOUTLINES, PDF_USETHUMBS, PDF_V, PDF_VALUECHANGE, PDF_VERSION, PDF_VERT_STEM, PDF_VERTICAL, PDF_VERTICES, PDF_VIEWER_PREFERENCES, PDF_W, PDF_WATERMARKANNOT, PDF_WIDGET, PDF_WIDTH, PDF_WIDTHS, PDF_WINANSIENCODING, PDF_WIPE, PDF_X, PDF_XOBJECT, PDF_XREF, PDF_XREFSTMOFFSET, PDF_XREFSTREAM, PDF_XSTEP, PDF_XYZ, PDF_YES, PDF_YSTEP, PIXEL_PER_INCH, RUBICON_EMBEDDED, SITE, TEXT, TWIPS_TO_POINTS
 
Constructor Summary
PdfFormField(int type, String name)
          Constructs a form field of specified type with specified name.
PdfFormField(int type, String name, int fieldflags)
          Constructs a form field of specified type with specified name and flags.
PdfFormField(int type, String name, String alternateName, String mappingName)
          Constructs a form field of specified type with specified name, alternate name and flags.
PdfFormField(int type, String name, String alternateName, String mappingName, int fieldFlags)
          Constructs a form field of specified type with specified name, alternate name, mapping name and flags.
PdfFormField(String name)
          Constructs a form field with specified name.
PdfFormField(String name, int fieldflags)
          Constructs a form field with specified name and flags.
PdfFormField(String name, String alternateName, String mappingName)
          Constructs a form field with specified name, alternate name, and mapping name.
PdfFormField(String name, String alternateName, String mappingName, int fieldFlags)
          Constructs a form field with specified name, alternate name, mapping name, and flags.
 
Method Summary
 void addAction(int eventType, int namedAction)
          Adds specified named action to specified event of the form field.
 void addAction(int actionType, int eventType, String javascriptOrUri)
          Adds specified Javascript or URI action to specified event of the form field.
 void addAction(int actionType, int eventType, String applicationToLaunch, boolean isPrint)
          Adds specified launch action to specified event of the form field.
 void addActionFormReset(int eventType)
          Adds an action to reset the form for the specified event of this form field.
 void addActionFormReset(int eventType, ArrayList fields, boolean exclude)
          Adds an action to exclusively reset or not reset specified form fields for specified event of this form field.
 void addActionFormReset(int eventType, PdfFormField field, boolean exclude)
          Adds an action to exclusively reset or not reset specified form field for specified event of this form field.
 void addActionFormSubmit(int eventType, String URI)
          Add an action to submit the form to specified URI for specified event of this form field.
 void addActionFormSubmit(int eventType, String URI, ArrayList fields, boolean exclude)
          Adds an action to exclusively submit or not submit specified form fields to a specified URI for specified event of this form field.
 void addActionFormSubmit(int eventType, String URI, PdfFormField field, boolean exclude)
          Adds an action to exclusively submit or not submit a specified form field to a specified URI for specified event of this form field.
 void addActionImportData(int eventType, String fdfFileName)
          Adds an action to import FDF (Forms Data Form) data into the form from a specified file for specified event of the form field.
 void addChildField(PdfFormField child)
          Adds specified form field as a child form field to this form field.
 Object clone()
           
 void flatten()
          Flattens this form field.
 void flatten(boolean flattenWithNewValue)
          Flattens this form field with or without its new value.
 String getAlternateName()
          Returns alternate name of the form field.
 Color getBackgroundColor()
          Returns background color of the form field.
 Color getBorderColor()
          Return border color of the form field.
 List getCheckGroupItems()
          Returns list of check box fields in this (check box group) form field.
 int[] getCheckGroupSelectedIndices()
          Returns indices of selected check box fields in this (check box group) form field.
 List getCheckGroupSelectedValues()
          Return list of selected check box fields in this (check box group) form field.
 int getChildCount()
          Returns number of children form fields for this group form field.
 List getChildList()
          Returns list of children form fields for this group form field.
 String getDefaultValue()
          Returns default value that the form field reverts to when the form is reset.
 PdfAppearanceStream getDownAppearance()
          Returns the appearance stream that needs to be used by a viewer application to display the annotation/form field when the user places the mouse pointer over the annotation/form field and holds down the mouse button.
 int getFieldFlags()
          Returns flags specified for the form field.
 PdfFont getFont()
          Returns font specified for this form field.
 String getFullyQualifiedName()
          Returns a dot-delimited string representing parent-child hierarchy of the form field.
 String getMappingName()
          Returns "mapping name" of the form field.
 String getName()
          Returns name used to identify the form field in the document.
 PdfAppearanceStream getNormalAppearance()
          Returns the default appearance stream that needs to be used by a viewer application to display the annotation/form field (that is, when the user is not interacting with the annotation/form field).
 PdfPopUpAnnot getPopup()
          Returns a popup annotation that needs to be used by a viewer application to display the popup window for this annotation.
 int[] getRadioGroupSelectedIndices()
          Returns indices of radio button fields that are selected in this (radio button group) form field.
 List getRadioGroupSelectedValues()
          Returns list of radio button fields that are selected in this (radio button group) form field.
 PdfAppearanceStream getRolloverAppearance()
          Returns the appearance stream that needs to be used by a viewer application to display the annotation when the user places the mouse pointer over the annotation (and does not hold down the mouse button).
 int getRotation()
          Returns angle of rotation of the form field.
 int getType()
          Returns form field type.
 String getValue()
          Returns current value of the form field.
 boolean isFlattened()
           
 boolean isNameAsUnicode()
          Returns whether all names of the form field is required to be specified in Unicode.
 boolean isNoExport()
          Returns whether form field is not required to be submitted when the form is submitted.
 boolean isNoSpellCheck()
          Returns whether the text option entered by a user in the combo box is not required to be spell-checked by a viewer application.
 boolean isRadioInUnison()
          Returns whether the FLAG_RADIO_IN_UNISON flag for the form field has been set.
 boolean isRadioNoToggleToOff()
          Returns whether the FLAG_RADIO_NO_TOGGLE_TO_OFF flag is set or cleared for the form field.
 boolean isReadOnly()
          Returns whether the form field properties cannot be changed by the user on a viewer application.
 boolean isRequired()
          Returns whether the form field needs to have a value when the form is submitted.
 void setAlternateName(String alternateName)
          Specify an "alternate name" for the form field.
 void setBackgroundColor(Color backgroundColor)
          Specify background color for the form field.
 void setBorderColor(Color borderColor)
          Specify border color for the form field.
 void setDefaultValue(String defaultValue)
          Specifies a value that the form field needs to revert to when the form is reset.
 void setDownAppearance(PdfAppearanceStream downAppearance)
          Specifies the appearance stream that needs to be used by a viewer application to display the annotation/form field when the user places the mouse pointer over the annotation/form field and holds down the mouse button.
 void setFieldFlags(int fieldFlags)
          Specifies flags for the form field.
 void setFont(PdfFont font)
          Specifies a font that needs to be used to display the contents of this form field.
 void setIncludeNoValueFieldsOnSubmit(boolean includeNoValueFieldsOnSubmit)
           
 void setMappingName(String mappingName)
          Specifies a "mapping name" for the form field.
 void setName(String name)
          Specifies a name that will be used to identify the form field in the document.
 void setNameAsUnicode(boolean isNameAsUnicode)
          Specifies whether all names of the form field needs to be specified in Unicode.
 void setNoExport(boolean noExport)
          Specifies whether form field is not required to be submitted when the form is submitted.
 void setNormalAppearance(PdfAppearanceStream normalAppearance)
          Specifies the default appearance stream that needs to be used by a viewer application to display the annotation/form field (that is, when the user is not interacting with the annotation/form field).
 void setNoSpellCheck(boolean noSpellCheck)
          Specifies whether the text option entered by a user in the combo box needs not to be spell-checked by a viewer application.
 void setParentAsNull()
          Removes this form field from its group.
 void setPopup(PdfPopUpAnnot popup, boolean overridePopUpProperties)
          Specifies a popup annotation that needs to be used by a viewer application to display the popup window for this annotation.
 void setRadioInUnison(boolean radioInUnison)
          Sets or clears the FLAG_RADIO_IN_UNISON flag for the form field.
 void setRadioNoToggleToOff(boolean radioToggleToOff)
          Sets or clears the FLAG_RADIO_NO_TOGGLE_TO_OFF flag for the form field.
 void setReadOnly(boolean readOnly)
          Specifies whether the form field properties cannot be changed by the user on a viewer application.
 void setRequired(boolean required)
          Specifies whether the form field needs to have a value when the form is submitted.
 void setRolloverAppearance(PdfAppearanceStream rolloverAppearance)
          Specifies the appearance stream that needs to be used by a viewer application to display the annotation/form field when the user places the mouse pointer over the annotation/form field (and does not hold down the mouse button).
 void setRotation(int rotation)
          Specifies angle of rotation of the form field.
 void setSubmitActionType(int submitActionType)
           
 void setType(int type)
          Specifies form field type.
 void setValue(String value)
          Specifies a new value for the form field.
 
Methods inherited from class com.gnostice.pdfone.PdfAnnot
delete, getAnnotName, getBorderStyle, getBorderWidth, getBottom, getColor, getContents, getDashPattern, getFlags, getLeft, getRect, getRight, getSubject, getTitle, getTop, hashCode, isDeleted, isShowRect, setAnnotName, setBorderStyle, setBorderWidth, setColor, setContents, setDashPattern, setFlags, setRect, setRect, setRect, setRect, setRect, setShowRect, setSubject, setTitle
 
Methods inherited from class java.lang.Object
equals, getClass, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

BUTTON_STATE_OFF

public static final int BUTTON_STATE_OFF
Constant for specifying that a radio button/check box is not selected.

See Also:
Constant Field Values

BUTTON_STATE_ON

public static final int BUTTON_STATE_ON
Constant for specifying that a radio button/check box is selected.

See Also:
Constant Field Values

FLAG_NONE

public static final int FLAG_NONE
A flag indicating that no other has been set and that the field simply inherits the flags of the parent form field.

See Also:
Constant Field Values

FLAG_READONLY

public static final int FLAG_READONLY
A flag indicating that the form field's properties cannot be changed by the user. This flag is useful for fields holding calculated or imported values.

See Also:
Constant Field Values

FLAG_REQUIRED

public static final int FLAG_REQUIRED
A flag indicating that the form field needs to have a value when the form is submitted.

See Also:
Constant Field Values

FLAG_NO_EXPORT

public static final int FLAG_NO_EXPORT
A flag indicating that the form field will not be submitted when the form is submitted.

See Also:
Constant Field Values

FLAG_CHOICE_MULTISELECT

public static final int FLAG_CHOICE_MULTISELECT
A flag indicating that multiple options in a combo box/list box can be selected. If the flag is not set, only one option can be selected.

See Also:
Constant Field Values

FLAG_NO_SPELLCHECK

public static final int FLAG_NO_SPELLCHECK
A flag indicating that text option entered by the user in the combo box is not spell-checked.

See Also:
Constant Field Values

FLAG_CHOICE_COMMIT_ON_SEL_CHANGE

public static final int FLAG_CHOICE_COMMIT_ON_SEL_CHANGE
A flag indicating that actions associated with the list box or combo box form field are executed immediately when an option is selected.

See Also:
Constant Field Values

FLAG_RADIO_IN_UNISON

public static final int FLAG_RADIO_IN_UNISON
A flag indicating that the radio button can be selected or deselected in unison with other radio buttons in its group. If this flag is not set, only one of the buttons can remain selected at any time.

See Also:
Constant Field Values

FLAG_RADIO_NO_TOGGLE_TO_OFF

public static final int FLAG_RADIO_NO_TOGGLE_TO_OFF
A flag indicating that the radio button or another one in its group will remain selected at any time. If one of the buttons is already selected, clicking that button will not deselect it. If this flag is not set, clicking a selected button will deselect it.

See Also:
Constant Field Values

SUBMIT_ACTION_TYPE_HTML_POST

public static final int SUBMIT_ACTION_TYPE_HTML_POST
See Also:
Constant Field Values

SUBMIT_ACTION_TYPE_FDF

public static final int SUBMIT_ACTION_TYPE_FDF
See Also:
Constant Field Values

SUBMIT_ACTION_TYPE_XFDF

public static final int SUBMIT_ACTION_TYPE_XFDF
See Also:
Constant Field Values

FLAG_SUBMIT_TYPE_FDF

public static final int FLAG_SUBMIT_TYPE_FDF
See Also:
Constant Field Values

HIGHLIGHT_MODE_NONE

public static final int HIGHLIGHT_MODE_NONE
Highlight mode for a form field that makes it appear without any change from its normal appearance.

See Also:
Constant Field Values

HIGHLIGHT_MODE_INVERT

public static final int HIGHLIGHT_MODE_INVERT
Highlight mode for a form field that makes the contents inside its bounding box appear inverted.

See Also:
Constant Field Values

HIGHLIGHT_MODE_OUTLINE

public static final int HIGHLIGHT_MODE_OUTLINE
Highlight mode for a form field that makes the border of its bounding box appear inverted.

See Also:
Constant Field Values

HIGHLIGHT_MODE_PUSH

public static final int HIGHLIGHT_MODE_PUSH
Highlight mode for a form field that makes it look as if it were pushed up from below the surface of the page.

See Also:
Constant Field Values

HIGHLIGHT_MODE_TOGGLE

public static final int HIGHLIGHT_MODE_TOGGLE
Deprecated. Instead, use HIGHLIGHT_MODE_PUSH.

See Also:
Constant Field Values

ALIGNMENT_LEFT

public static final int ALIGNMENT_LEFT
Constant for aligning text inside a form field to left.

See Also:
Constant Field Values

ALIGNMENT_CENTER

public static final int ALIGNMENT_CENTER
Constant for aligning text inside a form field to both left and right.

See Also:
Constant Field Values

ALIGNMENT_RIGHT

public static final int ALIGNMENT_RIGHT
Constant for aligning text inside a form field to right.

See Also:
Constant Field Values

TYPE_PUSHBUTTON

public static final int TYPE_PUSHBUTTON
Constant specifying that a form field is a push button.

See Also:
Constant Field Values

TYPE_TEXTFIELD

public static final int TYPE_TEXTFIELD
Constant specifying that a form field is a text field.

See Also:
Constant Field Values

TYPE_RADIOGROUP

public static final int TYPE_RADIOGROUP
Constant specifying that a form field is a radio button group. Several radio buttons can be added to a radio button group field.

See Also:
Constant Field Values

TYPE_CHECKGROUP

public static final int TYPE_CHECKGROUP
Constant specifying that a form field is a check box group.

See Also:
Constant Field Values

TYPE_LISTBOX

public static final int TYPE_LISTBOX
Constant specifying that a form field is a list box.

See Also:
Constant Field Values

TYPE_COMBOBOX

public static final int TYPE_COMBOBOX
Constant specifying that a form field is a combo box.

See Also:
Constant Field Values

ROTATION_0

public static final int ROTATION_0
Constant for rotation of a form field by 0 degrees.

See Also:
setRotation(int), getRotation(), Constant Field Values

ROTATION_90

public static final int ROTATION_90
Constant for rotation of a form field by 90 degrees.

See Also:
setRotation(int), getRotation(), Constant Field Values

ROTATION_180

public static final int ROTATION_180
Constant for rotation of a form field by 180 degrees.

See Also:
setRotation(int), getRotation(), Constant Field Values

ROTATION_270

public static final int ROTATION_270
Constant for rotation of a form field by 270 degrees.

See Also:
setRotation(int), getRotation(), Constant Field Values

TYPE_SIGNATURE

public static final int TYPE_SIGNATURE
See Also:
Constant Field Values
Constructor Detail

PdfFormField

public PdfFormField(int type,
                    String name)
Constructs a form field of specified type with specified name.

Parameters:
type - constant specifying the type of the form field.
name - name of the form field in the document.
See Also:
setName(String)

PdfFormField

public PdfFormField(int type,
                    String name,
                    int fieldflags)
Constructs a form field of specified type with specified name and flags.

Parameters:
type - constant specifying the type of the form field.
name - name of the form field in the document.
fieldflags - form field flags.

PdfFormField

public PdfFormField(int type,
                    String name,
                    String alternateName,
                    String mappingName,
                    int fieldFlags)
Constructs a form field of specified type with specified name, alternate name, mapping name and flags.

Parameters:
type - constant specifying the type of the form field.
name - name of the form field in the document.
alternateName - alternate name of the form field.
mappingName - mapping name of the form field.
fieldFlags - form field flags.

PdfFormField

public PdfFormField(int type,
                    String name,
                    String alternateName,
                    String mappingName)
Constructs a form field of specified type with specified name, alternate name and flags.

Parameters:
type - constant specifying the type of the form field.
name - name of the form field in the document.
alternateName - alternate name of the form field.
mappingName - mapping name of the form field.

PdfFormField

public PdfFormField(String name)
Constructs a form field with specified name.

Parameters:
name - name of the form field in the document.

PdfFormField

public PdfFormField(String name,
                    int fieldflags)
Constructs a form field with specified name and flags.

Parameters:
name - name of the form field in the document.
fieldflags - form field flags.

PdfFormField

public PdfFormField(String name,
                    String alternateName,
                    String mappingName,
                    int fieldFlags)
Constructs a form field with specified name, alternate name, mapping name, and flags.

Parameters:
name - name of the form field in the document.
alternateName - alternate name of the form field.
mappingName - mapping name of the form field.
fieldFlags - form field flags.

PdfFormField

public PdfFormField(String name,
                    String alternateName,
                    String mappingName)
Constructs a form field with specified name, alternate name, and mapping name.

Parameters:
name - name of the form field in the document.
alternateName - alternate name of the form field.
mappingName - mapping name of the form field.
Method Detail

clone

public Object clone()

getRotation

public int getRotation()
Returns angle of rotation of the form field.

Returns:
constant specifying angle of rotation of the form field
See Also:
setRotation(int)

setRotation

public void setRotation(int rotation)
                 throws PdfException
Specifies angle of rotation of the form field. The form field is rotated on the center of its bounding box.

Parameters:
rotation - constant specifying angle of rotation of the for field
Throws:
PdfException - if rotation is set to angle other than ROTATION_0, ROTATION_90, ROTATION_180, and ROTATION_270.
See Also:
getRotation()

getFont

public PdfFont getFont()
Returns font specified for this form field. If no font has been specified, it returns null.

Returns:
font specified for this form field; null if no font has been specified.
See Also:
setFont(PdfFont)

setFont

public void setFont(PdfFont font)
Specifies a font that needs to be used to display the contents of this form field.

Parameters:
font - Specifies a font that needs to be used to display the contents of this form field.
See Also:
getFont()

getMappingName

public String getMappingName()
Returns "mapping name" of the form field. When a form is submitted to a website, a form field is identified by its "mapping name." If no mapping name was specified, the form field can be identified by its original name.

Returns:
name used to identify the form field when form contents are exported
See Also:
setMappingName(String), getName()

setMappingName

public void setMappingName(String mappingName)
Specifies a "mapping name" for the form field. When a form is submitted to a website, a form field is identified by its "mapping name." If no mapping name was specified, the form field can be identified by its original name.

Parameters:
mappingName - name that needs to be used for identifying the form field only when form contents are exported
See Also:
getMappingName(), setName(String), setAlternateName(String)

getAlternateName

public String getAlternateName()
Returns alternate name of the form field. Viewer application may display the alternate name as a tooltip.

Returns:
alternate name of the form field
See Also:
getName(), getMappingName(), setAlternateName(String)

setAlternateName

public void setAlternateName(String alternateName)
Specify an "alternate name" for the form field.

Parameters:
alternateName - "alternate name" for the form field.
See Also:
getAlternateName(), getName(), getMappingName()

getName

public String getName()
Returns name used to identify the form field in the document. When the form is submitted, the form field can be identified by this name, that is, if it does not have a "mapping name".

Returns:
name used for the form field in the document
See Also:
setName(String), getMappingName()

setName

public void setName(String name)
Specifies a name that will be used to identify the form field in the document. When the form is submitted, the form field can be identified by this name, that is, if it does not have a "mapping name".

Parameters:
name - name that needs to be used to identify the form field in the document
See Also:
getName(), setMappingName(String)

getFullyQualifiedName

public String getFullyQualifiedName()
Returns a dot-delimited string representing parent-child hierarchy of the form field.

Returns:
a dot-delimited string representing parent-child hierarchy of the form field

getFieldFlags

public final int getFieldFlags()
Returns flags specified for the form field.

Returns:
flags specified for the form field
See Also:
setFieldFlags(int)

setFieldFlags

public final void setFieldFlags(int fieldFlags)
Specifies flags for the form field.

Parameters:
fieldFlags - flags for the form field

getValue

public String getValue()
Returns current value of the form field.

Returns:
curent value of the form field
See Also:
setValue(String), setDefaultValue(String)

getDefaultValue

public String getDefaultValue()
Returns default value that the form field reverts to when the form is reset.

Returns:
default value that the form field reverts to when the form is reset
See Also:
getValue(), setDefaultValue(String), addActionFormReset(int)

setValue

public void setValue(String value)
Specifies a new value for the form field.

Parameters:
value - a new value for the form field
See Also:
getValue(), setDefaultValue(String), addActionFormReset(int), addActionFormSubmit(int, String)

setDefaultValue

public void setDefaultValue(String defaultValue)
Specifies a value that the form field needs to revert to when the form is reset.

Parameters:
defaultValue - value that the form field needs to revert to when the form is reset
See Also:
getDefaultValue(), setValue(String), addActionFormReset(int)

isRadioInUnison

public boolean isRadioInUnison()
Returns whether the FLAG_RADIO_IN_UNISON flag for the form field has been set.

Returns:
whether the FLAG_RADIO_IN_UNISON flag for the form field has been set
See Also:
setRadioInUnison(boolean)

setRadioInUnison

public void setRadioInUnison(boolean radioInUnison)
                      throws PdfException
Sets or clears the FLAG_RADIO_IN_UNISON flag for the form field.

Parameters:
radioInUnison - whether to set or clear the FLAG_RADIO_IN_UNISON flag. If true, the flag is set. If false, the flag is cleared.
Throws:
PdfException
See Also:
isRadioInUnison()

isRadioNoToggleToOff

public boolean isRadioNoToggleToOff()
Returns whether the FLAG_RADIO_NO_TOGGLE_TO_OFF flag is set or cleared for the form field.

Returns:
whether the FLAG_RADIO_NO_TOGGLE_TO_OFF flag is set or cleared for the form field
See Also:
setRadioNoToggleToOff(boolean)

setRadioNoToggleToOff

public void setRadioNoToggleToOff(boolean radioToggleToOff)
                           throws PdfException
Sets or clears the FLAG_RADIO_NO_TOGGLE_TO_OFF flag for the form field.

Parameters:
radioToggleToOff - whether to set or clear the FLAG_RADIO_NO_TOGGLE_TO_OFF flag. If true, the flag is set; if false, the flag is cleared.
Throws:
PdfException
See Also:
isRadioNoToggleToOff()

isNoExport

public boolean isNoExport()
Returns whether form field is not required to be submitted when the form is submitted.

Returns:
whether form field is not required to be submitted when the form is submitted
See Also:
setNoExport(boolean), FLAG_NO_EXPORT

setNoExport

public void setNoExport(boolean noExport)
Specifies whether form field is not required to be submitted when the form is submitted.

Parameters:
noExport - whether form field is not required to be submitted when the form is submitted
See Also:
isNoExport(), FLAG_NO_EXPORT

isReadOnly

public boolean isReadOnly()
Returns whether the form field properties cannot be changed by the user on a viewer application.

Returns:
whether the form field properties cannot be changed by the user on a viewer application
See Also:
setReadOnly(boolean), FLAG_READONLY

setReadOnly

public void setReadOnly(boolean readOnly)
Specifies whether the form field properties cannot be changed by the user on a viewer application.

Parameters:
readOnly - whether the form field properties cannot be changed by the user on a viewer application
See Also:
isReadOnly(), FLAG_READONLY

isRequired

public boolean isRequired()
Returns whether the form field needs to have a value when the form is submitted.

Returns:
whether the form field needs to have a value when the form is submitted.
See Also:
setRequired(boolean), FLAG_REQUIRED

setRequired

public void setRequired(boolean required)
Specifies whether the form field needs to have a value when the form is submitted.

Parameters:
required - If set to true, the form containing the form field can be submitted only when the field has a value.
See Also:
isRequired(), FLAG_REQUIRED

isNoSpellCheck

public boolean isNoSpellCheck()
Returns whether the text option entered by a user in the combo box is not required to be spell-checked by a viewer application.

Returns:
whether the text option entered by a user in the combo box is not required to be spell-checked by a viewer application
See Also:
setNoSpellCheck(boolean), FLAG_NO_SPELLCHECK

setNoSpellCheck

public void setNoSpellCheck(boolean noSpellCheck)
Specifies whether the text option entered by a user in the combo box needs not to be spell-checked by a viewer application.

Parameters:
noSpellCheck - whether the text option entered by a user in the combo box needs not to be spell-checked by the viewer application
See Also:
isNoSpellCheck(), FLAG_NO_SPELLCHECK

getBackgroundColor

public Color getBackgroundColor()
Returns background color of the form field.

Returns:
background color of the form field
See Also:
setBackgroundColor(Color)

setBackgroundColor

public void setBackgroundColor(Color backgroundColor)
Specify background color for the form field.

Parameters:
backgroundColor - background color for the form field
See Also:
getBackgroundColor()

getBorderColor

public Color getBorderColor()
Return border color of the form field.

Returns:
border color of the form field
See Also:
setBorderColor(Color)

setType

public void setType(int type)
Specifies form field type.

Parameters:
type - constant specifying form field type
See Also:
getType()

getType

public int getType()
Returns form field type.

Overrides:
getType in class PdfAnnot
Returns:
constant specifying form field type
See Also:
setType(int)

setBorderColor

public void setBorderColor(Color borderColor)
Specify border color for the form field.

Parameters:
borderColor - border color for the form field

getPopup

public PdfPopUpAnnot getPopup()
Deprecated. no replacement

Description copied from class: com.gnostice.pdfone.PdfProAnnot
Returns a popup annotation that needs to be used by a viewer application to display the popup window for this annotation.

Returns:
popup annotation that needs to be used as the popup window

setPopup

public void setPopup(PdfPopUpAnnot popup,
                     boolean overridePopUpProperties)
Deprecated. no replacement

Description copied from class: com.gnostice.pdfone.PdfProAnnot
Specifies a popup annotation that needs to be used by a viewer application to display the popup window for this annotation.

Parameters:
popup - popup annotation that needs to be used as the popup window
overridePopUpProperties - whether a viewer application should override the properties of the popup annotation with those of this annotation
See Also:
PdfProAnnot.getPopup()

flatten

public void flatten(boolean flattenWithNewValue)
Flattens this form field with or without its new value.

Parameters:
flattenWithNewValue - whether to flatten the form field with or without its new value
See Also:
PdfProDocument.flattenFormFields(boolean)

flatten

public void flatten()
Flattens this form field. Flattening removes all interactivity from the form field and its contents. If a new value is specified for the form field, then the form field will be flattened with the new value.

See Also:
PdfProDocument.flattenFormFields()

isFlattened

public boolean isFlattened()

addChildField

public final void addChildField(PdfFormField child)
                         throws PdfException
Adds specified form field as a child form field to this form field.

Parameters:
child - form field that needs to be added as a child
Throws:
PdfException - if an illegal argument is supplied, or if this form field is not an object of PdfFormField class but an object of a class derived from PdfFormField.
See Also:
TYPE_CHECKGROUP, TYPE_RADIOGROUP

getChildList

public List getChildList()
Returns list of children form fields for this group form field.

Returns:
list of children form fields for this group form field
See Also:
TYPE_CHECKGROUP, TYPE_RADIOGROUP, PdfProDocument.addFormField(PdfFormField, String[])

getCheckGroupItems

public List getCheckGroupItems()
Returns list of check box fields in this (check box group) form field.

Returns:
list of check box fields in this (check box group) form field;

getChildCount

public int getChildCount()
Returns number of children form fields for this group form field.

Returns:
number of children form fields for this group form field
See Also:
TYPE_CHECKGROUP, TYPE_RADIOGROUP, PdfProDocument.addFormField(PdfFormField f, String[] pageRanges)

getRadioGroupSelectedIndices

public int[] getRadioGroupSelectedIndices()
Returns indices of radio button fields that are selected in this (radio button group) form field.

Returns:
indices of radio button fields that are selected

getRadioGroupSelectedValues

public List getRadioGroupSelectedValues()
Returns list of radio button fields that are selected in this (radio button group) form field.

Returns:
list of radio button fields that are selected in this (radio button group) form field

getCheckGroupSelectedIndices

public int[] getCheckGroupSelectedIndices()
Returns indices of selected check box fields in this (check box group) form field.

Returns:
indices of selected check box fields in this (check box group) form field

getCheckGroupSelectedValues

public List getCheckGroupSelectedValues()
Return list of selected check box fields in this (check box group) form field.

Returns:
list of selected check box fields in this (check box group) form field

setSubmitActionType

public void setSubmitActionType(int submitActionType)
                         throws PdfException
Throws:
PdfException

setIncludeNoValueFieldsOnSubmit

public void setIncludeNoValueFieldsOnSubmit(boolean includeNoValueFieldsOnSubmit)

addActionFormSubmit

public void addActionFormSubmit(int eventType,
                                String URI)
                         throws PdfException
Add an action to submit the form to specified URI for specified event of this form field.

Parameters:
eventType - constant specifying the event.
URI - URI to which the form needs to be submitted.
Throws:
PdfException - if an illegal argument is supplied.

addActionFormSubmit

public void addActionFormSubmit(int eventType,
                                String URI,
                                ArrayList fields,
                                boolean exclude)
                         throws PdfException
Adds an action to exclusively submit or not submit specified form fields to a specified URI for specified event of this form field.

Parameters:
eventType - constant specifying the event.
URI - URI to which the form needs to be submitted.
fields - form fields that need to be included or not included when the form is submitted.
exclude - if true, the specified form fields are submitted. If not, all other form fields are submitted.
Throws:
PdfException - if an illegal argument is supplied.

addActionFormSubmit

public void addActionFormSubmit(int eventType,
                                String URI,
                                PdfFormField field,
                                boolean exclude)
                         throws PdfException
Adds an action to exclusively submit or not submit a specified form field to a specified URI for specified event of this form field.

Parameters:
eventType - constant specifying the event.
URI - URI to which the specified form field needs to be submitted.
field - form field that need to be included or excluded by the submit action.
exclude - if true, the specified form field is reset. If not, all other form fields are reset.
Throws:
PdfException - if an illegal argument is supplied.

addActionFormReset

public void addActionFormReset(int eventType)
                        throws PdfException
Adds an action to reset the form for the specified event of this form field.

Parameters:
eventType - constant specifying the event
Throws:
PdfException - if an illegal argument is supplied.
See Also:
PdfAction, PdfAction.PdfEvent, getDefaultValue(), getValue()

addActionFormReset

public void addActionFormReset(int eventType,
                               PdfFormField field,
                               boolean exclude)
                        throws PdfException
Adds an action to exclusively reset or not reset specified form field for specified event of this form field.

Parameters:
eventType - constant specifying the event.
field - form field that need to be included or excluded by the reset action.
exclude - if true, the specified form field is reset. If not, all other form fields are reset.
Throws:
PdfException - if an illegal argument is supplied.
See Also:
PdfAction, PdfAction.PdfEvent, getDefaultValue(), getValue()

addActionImportData

public void addActionImportData(int eventType,
                                String fdfFileName)
                         throws PdfException
Adds an action to import FDF (Forms Data Form) data into the form from a specified file for specified event of the form field.

Parameters:
eventType - constant specifying the event.
fdfFileName - pathname of the file containing FDF data
Throws:
PdfException - if an illegal argument is supplied.

addActionFormReset

public void addActionFormReset(int eventType,
                               ArrayList fields,
                               boolean exclude)
                        throws PdfException
Adds an action to exclusively reset or not reset specified form fields for specified event of this form field.

Parameters:
eventType - constant specifying the event.
fields - form fields that need to be included or excluded by the reset action.
exclude - if true, the specified form fields are reset. If not, all other form fields are reset.
Throws:
PdfException - if an illegal argument is supplied.
See Also:
PdfAction, PdfAction.PdfEvent, getDefaultValue(), getValue()

addAction

public void addAction(int eventType,
                      int namedAction)
               throws PdfException
Adds specified named action to specified event of the form field.

Parameters:
eventType - constant specifying the event.
namedAction - constant specifying the named action.
Throws:
PdfException - if an illegal argument is supplied.
See Also:
PdfAction.PdfEvent, PdfAction

addAction

public void addAction(int actionType,
                      int eventType,
                      String javascriptOrUri)
               throws PdfException
Adds specified Javascript or URI action to specified event of the form field.

Parameters:
actionType - constant identifying the action as a Javascript action or a URI action, that is, either PdfAction.JAVASCRIPT or PdfAction.URI.
eventType - constant specifying the event.
javascriptOrUri - Javascript string or URI that needs to be used used by the action.
Throws:
PdfException - if an illegal argument is supplied.

addAction

public void addAction(int actionType,
                      int eventType,
                      String applicationToLaunch,
                      boolean isPrint)
               throws PdfException
Adds specified launch action to specified event of the form field.

Parameters:
actionType - constant identifying the action as a launch action, that is, PdfAction.LAUNCH.
eventType - constant specifying the event.
applicationToLaunch - pathname of
  • an application that needs to be executed, or
  • a file that needs to be
    • opened (if isPrint is false)
    • printed (if isPrint is true)
    using the file's default application.
isPrint - whether the file needs to be printed (using its default application).
Throws:
PdfException - if an illegal argument is supplied.
See Also:
PdfAction, PdfAction.PdfEvent

setParentAsNull

public void setParentAsNull()
Removes this form field from its group.

See Also:
TYPE_CHECKGROUP, TYPE_RADIOGROUP, PdfProDocument.addFormField(PdfFormField f, String[] pageRanges)

isNameAsUnicode

public boolean isNameAsUnicode()
Returns whether all names of the form field is required to be specified in Unicode.

Returns:
whether all names of the form field is required to be specified in Unicode
See Also:
setNameAsUnicode(boolean), setAlternateName(String), setMappingName(String), setName(String)

setNameAsUnicode

public void setNameAsUnicode(boolean isNameAsUnicode)
Specifies whether all names of the form field needs to be specified in Unicode.

Parameters:
isNameAsUnicode - whether all names of the form field needs to be specified in Unicode
See Also:
isNameAsUnicode(), getAlternateName(), getMappingName(), getName()

getDownAppearance

public PdfAppearanceStream getDownAppearance()
Returns the appearance stream that needs to be used by a viewer application to display the annotation/form field when the user places the mouse pointer over the annotation/form field and holds down the mouse button.

See Also:
PdfProAnnot.getNormalAppearance(), PdfProAnnot.getDownAppearance(), PdfProAnnot.setNormalAppearance(PdfAppearanceStream), PdfProAnnot.setRolloverAppearance(PdfAppearanceStream), PdfProAnnot.setDownAppearance(PdfAppearanceStream)

setDownAppearance

public void setDownAppearance(PdfAppearanceStream downAppearance)
Specifies the appearance stream that needs to be used by a viewer application to display the annotation/form field when the user places the mouse pointer over the annotation/form field and holds down the mouse button.

See Also:
PdfProAnnot.getNormalAppearance(), PdfProAnnot.getDownAppearance(), PdfProAnnot.getRolloverAppearance(), PdfProAnnot.setNormalAppearance(PdfAppearanceStream), PdfProAnnot.setRolloverAppearance(PdfAppearanceStream)

getNormalAppearance

public PdfAppearanceStream getNormalAppearance()
Returns the default appearance stream that needs to be used by a viewer application to display the annotation/form field (that is, when the user is not interacting with the annotation/form field).

See Also:
PdfProAnnot.getDownAppearance(), PdfProAnnot.getRolloverAppearance(), PdfProAnnot.setNormalAppearance(PdfAppearanceStream), PdfProAnnot.setDownAppearance(PdfAppearanceStream), PdfProAnnot.setRolloverAppearance(PdfAppearanceStream)

setNormalAppearance

public void setNormalAppearance(PdfAppearanceStream normalAppearance)
Specifies the default appearance stream that needs to be used by a viewer application to display the annotation/form field (that is, when the user is not interacting with the annotation/form field).

Parameters:
normalAppearance - the specified appearance stream
See Also:
PdfProAnnot.setDownAppearance(PdfAppearanceStream), PdfProAnnot.setRolloverAppearance(PdfAppearanceStream), PdfProAnnot.getNormalAppearance(), PdfProAnnot.getDownAppearance(), PdfProAnnot.getRolloverAppearance()

getRolloverAppearance

public PdfAppearanceStream getRolloverAppearance()
Returns the appearance stream that needs to be used by a viewer application to display the annotation when the user places the mouse pointer over the annotation (and does not hold down the mouse button).

See Also:
PdfProAnnot.getNormalAppearance(), PdfProAnnot.getDownAppearance(), PdfProAnnot.setNormalAppearance(PdfAppearanceStream), PdfProAnnot.setDownAppearance(PdfAppearanceStream), PdfProAnnot.setRolloverAppearance(PdfAppearanceStream)

setRolloverAppearance

public void setRolloverAppearance(PdfAppearanceStream rolloverAppearance)
Specifies the appearance stream that needs to be used by a viewer application to display the annotation/form field when the user places the mouse pointer over the annotation/form field (and does not hold down the mouse button).

Parameters:
rolloverAppearance - the specified appearance stream
See Also:
PdfProAnnot.setNormalAppearance(PdfAppearanceStream), PdfProAnnot.setDownAppearance(PdfAppearanceStream), PdfProAnnot.getNormalAppearance(), PdfProAnnot.getDownAppearance(), PdfProAnnot.getRolloverAppearance()

Gnostice PDFOne
Pro. Ed. v5.0.0

To contact our support team, send an e-mail to support@gnostice.com.
 
© 2010 Gnostice Information Technologies Private Limited. All rights reserved.
www.gnostice.com