Class FormObject
-
Field Summary
Modifier and TypeFieldDescriptionstatic final int
If set, the field is a combo box; if clear, the field is a list box.static final int
If set, the field shall not scroll (horizontally for single-line fields, vertically for multiple-line fields) to accommodate more text than fits within its annotation rectangle.static final int
If set, text entered in the field shall not be spell-checked.static final int
If set, the combo box shall include an editable text box as well as a drop-down list; if clear, it shall include only a drop-down list.static Color
static final int
If set, the field may contain multiple lines of text; if clear, the field’s text shall be restricted to a single line.static final int
If set, more than one of the field’s option items may be selected simultaneously; if clear, at most one item shall be selected.static final int
If set, the field shall not be exported by a submit-form actionstatic final int
(Radio buttons only) If set, exactly one radio button shall be selected at all times; selecting the currently selected button has no effect.static final int
If set, the field is intended for entering a secure password that should not be echoed visibly to the screen.static final int
static final int
If set, the field is a push-button that does not retain a permanent value.static final int
If set, the field is a set of radio buttons; if clear, the field is a check box.static final int
If set, an interactive PDF processor shall not allow a user to change the value of the field.static final int
If set, the field shall have a value at the time it is exported by a submit-form action .static final int
RichText:static final int
If set, the field’s option items shall be sorted alphabetically.Fields inherited from class org.jpedal.objects.raw.PdfObject
DECODED, stream, UNDECODED_DIRECT, UNDECODED_REF
-
Constructor Summary
ConstructorDescriptionFormObject
(int type) FormObject
(int ref, int gen) FormObject
(String ref) FormObject
(String ref, boolean flag) FormObject
(String ref, int parentType) -
Method Summary
Modifier and TypeMethodDescriptionString[][]
choiceIndicesToOptions
(int[] indices) Convert a list of indices into a list of the options they representint[]
choiceOptionsToIndices
(String[] options, boolean optionsAreDisplay) Convert a list of options into a list of indicesint
choiceOptionToIndex
(String option, boolean optionIsDisplay) Get the index of the given optionvoid
copyInheritedValuesFromParent
(FormObject parentObj) overwrites all the values on this form with any values from the parentboolean
org.jpedal.objects.raw.PdfObject
String[]
flipChoiceOption
(String[] values, boolean valuesAreDisplay) Flip the choice optionflipChoiceOption
(String value, boolean valueIsDisplay) Flip a choice optionstatic Color
generateColor
(float[] toks) takes a value and turns it into the color it represents, e.g. (0.5) represents gray (127,127,127) grey = array length 1, with one value rgb = array length 3, in the order of red,green,blue cmyk = array length 4, in the reverse order, (ie. k, y, m, c)int
get status found during decodeint
boolean
getBoolean
(int id) This method should be called only in tabbing functionalityreturn the bounding rectangle for this objectboolean[]
String[][]
Get the available choice options for this choice fieldfloat
Get the first element of the default fieldValues
for when the field only expects a single valueString[]
Get the default Field Values
For when the field can have multiple valuesorg.jpedal.objects.raw.PdfObject
getDictionary
(int id) String[]
Get the export values of the choice fieldboolean[]
returns the flags array (Ff in PDF) (indexs are the number listed)
* all
1=readonly - if set there is no interaction
2=required - if set the field must have a value when submit-form-action occures
3=noexport - if set the field must not be exported by a submit-form-action
Choice fields
18=combo - set its a combobox, else a list box
19=edit - defines a comboBox to be editable
20=sort - defines list to be sorted alphabetically
22=multiselect - if set more than one items can be selected, else only one
23=donotspellcheck - (only used on editable combobox) don't spell check
27=commitOnselchange - if set commit the action when selection changed, else commit when user exits field
text fields
13=multiline - uses multipul lines else uses a single line
14=password - a password is intended
21=fileselect -text in field represents a file pathname to be submitted
23=donotspellcheck - don't spell check
24=donotscroll - once the field is full don't enter anymore text.Get the first element of the fieldValues
For when the field only expects a single valueString[]
Get the fieldValues
For when the field can have multiple valuesfloat[][]
getFloat2DArray
(int id) float[]
getFloatArray
(int id) float
getFloatNumber
(int id) float
Method to get the font size to be used in the form component This is currently only implemented for text pop-up formsint
look at FormFactory.LIST etc for full list of typesGet the current value of the form fieldint
getInt
(int id) int[]
getIntArray
(int id) String[]
Get the display values of the choice fieldbyte[][]
getKeyArray
(int id) used by JS to resetint[]
Method returns matte border details of Form (not all surrounding element)org.jpedal.objects.raw.PdfArrayIterator
getMixedArray
(int id) getName
(int id) int
getNameAsConstant
(int id) Object[]
getObjectArray
(int id) static BufferedImage
org.jpedal.objects.raw.PdfObject
gets the parent for this fieldbyte[][]
int
Get the index of the selected item for this choice fieldGet the selected item for this choice fieldString[]
Get the selected items for this choice fieldint[]
Get the indices of the selected items for this choice fieldbyte[][]
getStringArray
(int id) int
int
getTextStreamValue
(int id) byte[]
getTextStreamValueAsByte
(int id) getValue()
returns the current value for this field, if text field the text string, if choice field the selected item (Does not account for multi choice fields) if button field the normal captiongetValuesMap
(boolean keyFirst) Deprecated.boolean
boolean
boolean
boolean
boolean
Check whether element exists within HTML page content and should not be rasterized on background (but still rasterize on thumbnail)boolean
boolean
Get whether this radio button or checkbox is checkedboolean
void
reset this form field to its default value If the field doesn't have a default value, then it will be emptiedvoid
setActionFlag
(int popup) used internally to set status while parsing - should not be calledvoid
setAddedToHTML
(boolean isAddedToHTML) Flag that element exists within HTML page content and should not be rasterized on background (but still rasterize on thumbnail)void
setAppreancesUsed
(boolean used) void
setBoolean
(int id, boolean value) void
setCurrentScaling
(float scale) Set the scaling for the formObject this is only used for the locations of forms that can move such as Text Popupsvoid
setDictionary
(int id, org.jpedal.objects.raw.PdfObject value) void
setFloat2DArray
(int id, float[][] values) void
setFloatArray
(int id, float[] value) void
setFloatNumber
(int id, float value) void
setFontName
(String font) set the text font for this formvoid
setFormType
(int widgetType) void
setFormValue
(Object value) Set the value of the form fieldvoid
setGUIComponent
(Object guiComp, int guiType) void
setHTMLElementId
(String htmlElementId) void
setIntArray
(int id, int[] value) void
setIntNumber
(int id, int value) void
setKeyArray
(int id, byte[][] value) void
setLastValidValue
(String value) used by JS to resetvoid
setMixedArray
(int id, byte[][] value) void
setName
(int id, byte[] value) void
setNormalOnState
(String state) set the state which is defined as the On state for this form
usually different for each child so that the selected child can be found by the statevoid
setObjectArray
(int id, Object[] objectValues) void
setPageRotation
(int rotation) void
sets the parent for this fieldvoid
setParent
(String parent, FormObject parentObj, boolean copyValuesFromParent) sets the parent string for this field and stores the parent PDFObject passed in to be accessed locally and from getParent() BEWARE :- this method will copy all relevent values from the parent is copyValuesFromParent is truevoid
setParentPdfObj
(org.jpedal.objects.raw.PdfObject parent) void
setRawKids
(byte[][] kidsInParent) void
setSelected
(boolean setSelected) Set whether this radio button or checkbox is checkedvoid
setSelection
(Object[] selectedValues, String curValue, int[] indices, int index) Deprecated.As curValue and index are ignored,setSelection(String[], int[])
, orsetSelection(String, int)
is preferredvoid
setSelection
(String[] selectedValues, int[] indices) Set the currently selected items of the choice fieldvoid
setSelection
(String[] selectedValues, int[] indices, boolean sync) Set the currently selected items of the choice fieldvoid
setSelection
(String selectedValue, int index) Set the currently selected item of the choice fieldvoid
setStringArray
(int id, byte[][] keyValues) void
setTextColor
(float[] color) sets the text color for this formvoid
setTextFont
(Font font) set the text font for this formvoid
setTextSize
(int size) sets the text size for this formvoid
setTextStreamValue
(int id, byte[] value) void
setTextString
(String textString) Set the value of the text string, syncing the GUI if presentvoid
setVisible
(boolean isVisible) void
updateValue
(Object value, boolean isSelected, boolean sync) allow us to update value (and sync to GUI if exists)Methods inherited from class org.jpedal.objects.raw.PdfObject
getArrayRef, getBooleanArray, getByteArray, getCachedStreamFile, getCacheName, getClip, getConvertedData, getDecodedStream, getDoubleArray, getGeneralStringValue, getGeneralType, getID, getKeyPairsIterator, getLong, getObjectRefAsString, getObjectRefGeneration, getObjectRefID, getObjectType, getPageNumber, getParentID, getPassword, getPDFkeyInt, getRawObjectType, getStatus, getStringKey, getStringValue, getUnresolvedData, hasStream, ignoreRecursion, ignoreRecursion, ignoreStream, ignoreStream, isCached, isCompressedStream, isDataExternal, isDataExternal, isFullyResolved, isInCompressedStream, moveCacheValues, setArrayRef, setBooleanArray, setCache, setClip, setCompressedStream, setConstant, setConstant, setConvertedData, setDecodedStream, setDictionaryPairs, setDoubleArray, setFullyResolved, setGeneralStringValue, setID, setInCompressedStream, setLong, setPageNumber, setRef, setStatus, setStream, setStreamMayBeCorrupt, setStringKey, setTextStreamValue, setUnresolvedData, streamMayBeCorrupt, validateRectangle
-
Field Details
-
FieldsHightlightColor
-
READONLY_ID
public static final int READONLY_IDIf set, an interactive PDF processor shall not allow a user to change the value of the field. Additionally, any associated widget annotations should not interact with the user; that is, they should not respond to mouse clicks nor change their appearance in response to mouse motions.NOTE: This flag is useful for fields whose values are computed or imported from a database.
1 form flag indexes for the field flags
- See Also:
-
REQUIRED_ID
public static final int REQUIRED_IDIf set, the field shall have a value at the time it is exported by a submit-form action .2 form flag indexes for the field flags
- See Also:
-
NOEXPORT_ID
public static final int NOEXPORT_IDIf set, the field shall not be exported by a submit-form action3 form flag indexes for the field flags
- See Also:
-
MULTILINE_ID
public static final int MULTILINE_IDIf set, the field may contain multiple lines of text; if clear, the field’s text shall be restricted to a single line.13 form flag indexes for the field flags
- See Also:
-
PASSWORD_ID
public static final int PASSWORD_IDIf set, the field is intended for entering a secure password that should not be echoed visibly to the screen. Characters typed from the keyboard shall instead be echoed in some unreadable form, such as asterisks or bullet characters.NOTE To protect password confidentiality, it is imperative that PDF processors never store the value of the text field in the PDF file if this flag is set.
14 form flag indexes for the field flags
- See Also:
-
NOTOGGLETOOFF_ID
public static final int NOTOGGLETOOFF_ID(Radio buttons only) If set, exactly one radio button shall be selected at all times; selecting the currently selected button has no effect. If clear, clicking the selected button deselects it, leaving no button selected.15 form flag indexes for the field flags
- See Also:
-
RADIO_ID
public static final int RADIO_IDIf set, the field is a set of radio buttons; if clear, the field is a check box. This flag may be set only if the Pushbutton flag is clear.16 form flag indexes for the field flags
- See Also:
-
PUSHBUTTON_ID
public static final int PUSHBUTTON_IDIf set, the field is a push-button that does not retain a permanent value.17 form flag indexes for the field flags
- See Also:
-
COMBO_ID
public static final int COMBO_IDIf set, the field is a combo box; if clear, the field is a list box.18 form flag indexes for the field flags
- See Also:
-
EDIT_ID
public static final int EDIT_IDIf set, the combo box shall include an editable text box as well as a drop-down list; if clear, it shall include only a drop-down list. This flag shall be used only if the Combo flag is set19 form flag indexes for the field flags
- See Also:
-
SORT_ID
public static final int SORT_IDIf set, the field’s option items shall be sorted alphabetically. This flag is intended for use by PDF writers, not by PDF readers. PDF readers shall display the options in the order in which they occur in the Opt array.20 form flag indexes for the field flags
- See Also:
-
MULTISELECT_ID
public static final int MULTISELECT_IDIf set, more than one of the field’s option items may be selected simultaneously; if clear, at most one item shall be selected.22 form flag indexes for the field flags
- Since:
- PDF 1.4
- See Also:
-
DONOTSPELLCHECK_ID
public static final int DONOTSPELLCHECK_IDIf set, text entered in the field shall not be spell-checked.Specifically for combo boxes: This flag shall not be used unless the Combo and Edit flags are both set.
23 form flag indexes for the field flags
- Since:
- PDF 1.4
- See Also:
-
DONOTSCROLL_ID
public static final int DONOTSCROLL_IDIf set, the field shall not scroll (horizontally for single-line fields, vertically for multiple-line fields) to accommodate more text than fits within its annotation rectangle. Once the field is full, no further text shall be accepted for interactive form filling; for non-interactive form filling, the filler should take care not to add more character than will visibly fit in the defined area.24 form flag indexes for the field flags
- Since:
- PDF 1.4
- See Also:
-
RICHTEXT_AND_RADIOINUNISON_ID
public static final int RICHTEXT_AND_RADIOINUNISON_IDRichText:If set, the value of this field shall be a rich text string. If the field has a value, the RV entry of the field dictionary shall specify the rich text string.
Radios In Unison:If set, a group of radio buttons within a radio button field that use the same value for the on state will turn on and off in unison; that is if one is checked, they are all checked. If clear, the buttons are mutually exclusive (the same behaviour as HTML radio buttons).
26 form flag indexes for the field flags
- Since:
- PDF 1.5
- See Also:
-
POPUP
public static final int POPUP- See Also:
-
-
Constructor Details
-
FormObject
-
FormObject
-
FormObject
public FormObject(int ref, int gen) -
FormObject
public FormObject(int type) -
FormObject
public FormObject() -
FormObject
-
-
Method Details
-
setHTMLElementId
-
getHTMLElementId
-
getBoolean
public boolean getBoolean(int id) - Overrides:
getBoolean
in classorg.jpedal.objects.raw.PdfObject
-
setBoolean
public void setBoolean(int id, boolean value) - Overrides:
setBoolean
in classorg.jpedal.objects.raw.PdfObject
-
getActionFlag
public int getActionFlag()get status found during decode- Returns:
- the value of the popup flag
-
setActionFlag
public void setActionFlag(int popup) used internally to set status while parsing - should not be called- Parameters:
popup
- the popup flag value
-
getDictionary
public org.jpedal.objects.raw.PdfObject getDictionary(int id) - Overrides:
getDictionary
in classorg.jpedal.objects.raw.PdfObject
-
setDictionary
public void setDictionary(int id, org.jpedal.objects.raw.PdfObject value) - Overrides:
setDictionary
in classorg.jpedal.objects.raw.PdfObject
-
getInt
public int getInt(int id) - Overrides:
getInt
in classorg.jpedal.objects.raw.PdfObject
-
setIntNumber
public void setIntNumber(int id, int value) - Overrides:
setIntNumber
in classorg.jpedal.objects.raw.PdfObject
-
getFloatNumber
public float getFloatNumber(int id) - Overrides:
getFloatNumber
in classorg.jpedal.objects.raw.PdfObject
-
setFloatNumber
public void setFloatNumber(int id, float value) - Overrides:
setFloatNumber
in classorg.jpedal.objects.raw.PdfObject
-
getNameAsConstant
public int getNameAsConstant(int id) - Overrides:
getNameAsConstant
in classorg.jpedal.objects.raw.PdfObject
-
getName
- Overrides:
getName
in classorg.jpedal.objects.raw.PdfObject
-
setName
public void setName(int id, byte[] value) - Overrides:
setName
in classorg.jpedal.objects.raw.PdfObject
-
getTextStreamValue
- Overrides:
getTextStreamValue
in classorg.jpedal.objects.raw.PdfObject
-
getTextStreamValueAsByte
public byte[] getTextStreamValueAsByte(int id) - Overrides:
getTextStreamValueAsByte
in classorg.jpedal.objects.raw.PdfObject
-
setTextStreamValue
public void setTextStreamValue(int id, byte[] value) - Overrides:
setTextStreamValue
in classorg.jpedal.objects.raw.PdfObject
-
getMixedArray
public org.jpedal.objects.raw.PdfArrayIterator getMixedArray(int id) - Overrides:
getMixedArray
in classorg.jpedal.objects.raw.PdfObject
-
setMixedArray
public void setMixedArray(int id, byte[][] value) - Overrides:
setMixedArray
in classorg.jpedal.objects.raw.PdfObject
-
getIntArray
public int[] getIntArray(int id) - Overrides:
getIntArray
in classorg.jpedal.objects.raw.PdfObject
-
setIntArray
public void setIntArray(int id, int[] value) - Overrides:
setIntArray
in classorg.jpedal.objects.raw.PdfObject
-
getFloatArray
public float[] getFloatArray(int id) - Overrides:
getFloatArray
in classorg.jpedal.objects.raw.PdfObject
-
setFloatArray
public void setFloatArray(int id, float[] value) - Overrides:
setFloatArray
in classorg.jpedal.objects.raw.PdfObject
-
setObjectArray
- Overrides:
setObjectArray
in classorg.jpedal.objects.raw.PdfObject
-
getObjectArray
- Overrides:
getObjectArray
in classorg.jpedal.objects.raw.PdfObject
-
setFloat2DArray
public void setFloat2DArray(int id, float[][] values) -
getFloat2DArray
public float[][] getFloat2DArray(int id) -
getKeyArray
public byte[][] getKeyArray(int id) - Overrides:
getKeyArray
in classorg.jpedal.objects.raw.PdfObject
-
setKeyArray
public void setKeyArray(int id, byte[][] value) - Overrides:
setKeyArray
in classorg.jpedal.objects.raw.PdfObject
-
setStringArray
public void setStringArray(int id, byte[][] keyValues) - Overrides:
setStringArray
in classorg.jpedal.objects.raw.PdfObject
-
getStringArray
public byte[][] getStringArray(int id) - Overrides:
getStringArray
in classorg.jpedal.objects.raw.PdfObject
-
getFieldValue
Get the first element of the fieldValues
For when the field only expects a single value- Returns:
- The first element of field values, or null if field values is null or empty
- See Also:
-
getFieldValues
Get the fieldValues
For when the field can have multiple values- Returns:
- The fieldValues
- See Also:
-
getDefaultFieldValue
Get the first element of the default fieldValues
for when the field only expects a single value- Returns:
- The first element of DV, or null if DV is null or empty
-
getDefaultFieldValues
Get the default Field Values
For when the field can have multiple values- Returns:
- The default field values
- See Also:
-
setSelection
@Deprecated public void setSelection(Object[] selectedValues, String curValue, int[] indices, int index) Deprecated.As curValue and index are ignored,setSelection(String[], int[])
, orsetSelection(String, int)
is preferredSets the selected items
Only applicable to choice fieldsPlease note that curValue and index are unused as they can be expressed in the selectedValues and indices.
- Parameters:
selectedValues
- an array of objects containing the selected valuescurValue
- unusedindices
- an array of indicesindex
- unused- See Also:
-
setSelection
Set the currently selected items of the choice field- Parameters:
selectedValues
- An array of strings containing the selected valuesindices
- An array of indices that reference the optValues. Where the indexes represent the users selection of the optionssync
- Sync this change in selection to theguiComp
, if available- See Also:
- Implementation Note:
- This is version of the method, with a sync variable, is required due to the way that updating a
List field works: a list field, when setting its selected indices, will first clear the selection. This
clear triggers the state change listener, which calls this method, which calls
updateChoiceFieldIndex()
, which sets the selected indices and becomes an infinite loop. The inclusion of the sync parameter allows the listener to deny a gui sync, preventing the loop.
-
setSelection
Set the currently selected items of the choice field- Parameters:
selectedValues
- An array of strings containing the selected valuesindices
- An array of indices that reference the optValues. Where the indexes represent the users selection of the options- See Also:
-
setSelection
Set the currently selected item of the choice field- Parameters:
selectedValue
- The value of the selected itemindex
- The index, referencing an element in the optValues}, of the selected item.- See Also:
-
getSelectedItem
Get the selected item for this choice fieldNote that some choice fields can have multiple values simultaneously, for those fields this method will only return the first selected item, you should instead use
getSelectedItems()
- Returns:
- the selected Item for this field
- See Also:
-
getSelectedItems
Get the selected items for this choice fieldNote that most fields can have only a single value selected at a time, for those fields this method will return a single item array. You may prefer to use
getSelectedItem()
.- Returns:
- the selected items for this field
- See Also:
-
getSelectedIndex
public int getSelectedIndex()Get the index of the selected item for this choice fieldThe indices refer to items in the opt array.
Note that some choice fields can have multiple values simultaneously, for those fields this method will only return the first selected index, you should instead use
getSelectionIndices()
.- Returns:
- The index of the selected item
- See Also:
-
getSelectionIndices
public int[] getSelectionIndices()Get the indices of the selected items for this choice fieldThe indices refer to items in the opt array.
Note that most choice fields can have only a single value selected at a time, for those fields this method will return a single item array. You may prefer to use
getSelectedIndex()
.- Returns:
- The indices of the selected items
- See Also:
-
getTextString
- Returns:
- The text string for this field - if no value set but a default (DV value) set, then return that, otherwise return an empty string.
-
setTextString
Set the value of the text string, syncing the GUI if present- Parameters:
textString
- The new text string
-
isSelected
public boolean isSelected()Get whether this radio button or checkbox is checkedThis only works for radio buttons and checkboxes, and will produce weird behaviour on other fields
- Returns:
- Whether this radio button or checkbox is checked
-
setSelected
public void setSelected(boolean setSelected) Set whether this radio button or checkbox is checked- Parameters:
setSelected
- Whether this radio button or checkbox is checked
-
resetToDefault
public void resetToDefault()reset this form field to its default value If the field doesn't have a default value, then it will be emptied -
getValue
returns the current value for this field, if text field the text string, if choice field the selected item (Does not account for multi choice fields) if button field the normal captionUse of this field is discouraged, where getting the value through the fields specific accessor is preferred
- Returns:
- current value of this field
- See Also:
-
updateValue
allow us to update value (and sync to GUI if exists)- Parameters:
value
- the new value to update withisSelected
- true if the object is selectedsync
- true if we want to sync
-
getFormValue
Get the current value of the form fieldUse of this field is discouraged, where getting the value through the fields specific accessor is preferred
- Returns:
- The current form field
-
setFormValue
Set the value of the form fieldUse of this field is discouraged, where setting the value through the fields specific accessor is preferred
- Parameters:
value
- The new value of the field
-
getItemsList
Get the display values of the choice field- Returns:
- the available items for this choice field
- See Also:
-
getExportList
Get the export values of the choice field- Returns:
- the available export items for this choice field
- See Also:
-
getChoiceOptions
Get the available choice options for this choice fieldThe returned value will be an array of options, where each option will be represented by a 2 component array. The first component will be the export value, and the second component will be the display value.
If the opt array is missing, then this returns an empty array.
- Returns:
- The available options for the choice field, or an empty array
- See Also:
-
choiceIndicesToOptions
Convert a list of indices into a list of the options they represent- Parameters:
indices
- A list of indices representing options in the opt values- Returns:
- A list of options([Export value, display value])
-
choiceOptionsToIndices
Convert a list of options into a list of indices- Parameters:
options
- The options of the opt values to look up These can be export values, or display values, as determined by the optionsAreDisplay parameteroptionsAreDisplay
- Whether the values in options represent export values or display values- Returns:
- A list of indices
-
choiceOptionToIndex
Get the index of the given option- Parameters:
option
- The option from the opt values to get the index of This can be an export value, or a display value, as determined by the optionIsDisplay parameteroptionIsDisplay
- Whether the option represents an export value or a display value- Returns:
- An index
-
flipChoiceOption
Flip the choice optionGets the display value from an export value, or an export value from a display value
- Parameters:
values
- The value to flipvaluesAreDisplay
- When true, the values being passed are the display values
When false, the values being passed are the export values- Returns:
- The choice options flipped
-
flipChoiceOption
Flip a choice optionGets the display value from an export value, or an export value from a display value
- Parameters:
value
- The value to flipvalueIsDisplay
- When true, the value being passed is the display value
When false, the value being passed is the export value- Returns:
- The choice option flipped, or the value if there isn't an entry for the value in the opt array
-
getValuesMap
Deprecated.This returns a map, which due to the potential of duplicate keys, may lose values, you should instead usegetChoiceOptions()
for an array of pairs- Parameters:
keyFirst
- true if we want the keys first- Returns:
- the values map for this field, map that references the display value from the export values
- See Also:
-
decompressStreamWhenRead
public boolean decompressStreamWhenRead()- Overrides:
decompressStreamWhenRead
in classorg.jpedal.objects.raw.PdfObject
-
generateColor
takes a value and turns it into the color it represents, e.g. (0.5) represents gray (127,127,127)- grey = array length 1, with one value
- rgb = array length 3, in the order of red,green,blue
- cmyk = array length 4, in the reverse order, (ie. k, y, m, c)
- Parameters:
toks
- an array of tokens- Returns:
- an object containing details of the color
-
isXFAObject
public boolean isXFAObject()- Returns:
- true if this formObject represents an XFAObject
-
duplicate
public org.jpedal.objects.raw.PdfObject duplicate() -
copyInheritedValuesFromParent
overwrites all the values on this form with any values from the parent- Parameters:
parentObj
- the parent form data object containing the details of the form object
-
getAlignment
public int getAlignment()- Returns:
- the alignment (Q)
-
setTextColor
public void setTextColor(float[] color) sets the text color for this form- Parameters:
color
- the text color for this form
-
setFontName
set the text font for this form- Parameters:
font
- the name of the font
-
setTextFont
set the text font for this form- Parameters:
font
- the name of the text font
-
setTextSize
public void setTextSize(int size) sets the text size for this form- Parameters:
size
- text size
-
setParent
sets the parent for this field- Parameters:
parent
- the parent of the field
-
setParent
sets the parent string for this field and stores the parent PDFObject passed in to be accessed locally and from getParent() BEWARE :- this method will copy all relevent values from the parent is copyValuesFromParent is true- Parameters:
parent
- the parent of the fieldparentObj
- a data object containing details of the parent form objectcopyValuesFromParent
- true if we are copying values from parent
-
getParentPdfObj
public org.jpedal.objects.raw.PdfObject getParentPdfObj() -
setParentPdfObj
public void setParentPdfObj(org.jpedal.objects.raw.PdfObject parent) -
getParentRef
gets the parent for this field- Returns:
- the parent object reference
-
getBounding2DRectangleForTabbing
This method should be called only in tabbing functionality- Returns:
- the bounded 2d rectangle object
-
getBoundingRectangle
return the bounding rectangle for this object- Returns:
- the bounding rectangle of the object
-
getFieldFlags
public boolean[] getFieldFlags()returns the flags array (Ff in PDF) (indexs are the number listed)
* all
1=readonly - if set there is no interaction
2=required - if set the field must have a value when submit-form-action occures
3=noexport - if set the field must not be exported by a submit-form-action
Choice fields
18=combo - set its a combobox, else a list box
19=edit - defines a comboBox to be editable
20=sort - defines list to be sorted alphabetically
22=multiselect - if set more than one items can be selected, else only one
23=donotspellcheck - (only used on editable combobox) don't spell check
27=commitOnselchange - if set commit the action when selection changed, else commit when user exits field
text fields
13=multiline - uses multipul lines else uses a single line
14=password - a password is intended
21=fileselect -text in field represents a file pathname to be submitted
23=donotspellcheck - don't spell check
24=donotscroll - once the field is full don't enter anymore text.
25=comb - (only if maxlen is present, (multiline, password and fileselect are CLEAR)), the text is justified across the field to MaxLen
26=richtext - use richtext format specified by RV entry in field dictionary
button fields
15=notoggletooff - (use in radiobuttons only) if set one button must always be selected
16=radio - if set is a set of radio buttons
17=pushbutton - if set its a push button, if neither 16 nor 17 its a check box
26=radiosinunison - if set all radio buttons with the same on state are turned on and off in unison (same behaviour as html browsers)- Returns:
- an array of the flags
-
setNormalOnState
set the state which is defined as the On state for this form
usually different for each child so that the selected child can be found by the state- Parameters:
state
- the normal on state
-
isAppearanceUsed
public boolean isAppearanceUsed()- Returns:
- whether or not appearances are used in this field
-
setAppreancesUsed
public void setAppreancesUsed(boolean used) -
hasDownImage
public boolean hasDownImage()- Returns:
- true if has one or more down images set
-
getCharacteristics
public boolean[] getCharacteristics()- Returns:
- the characteristics for this field.
bit 1 is index 0 in []
[0] 1 = invisible
[1] 2 = hidden - don't display or print
[2] 3 = print - print if set, don't if not
[3] 4 = nozoom
[4] 5= norotate
[5] 6= noview
[6] 7 = read only (ignored by widget)
[7] 8 = locked [8] 9 = togglenoview as on pdf 1.7 this became 10 bits long
[9] 10 = LockedContents
-
getTextSize
public int getTextSize()- Returns:
- the default text size for this field
-
getTextPosition
public int getTextPosition()- Returns:
- the position of the view of the text in this field
positioning of text relative to icon - (integer)
0=caption only 1=icon only
2=caption below icon
3=caption above icon
4=caption on right of icon
5=caption on left of icon
6=caption overlaid ontop of icon
-
getNormalOnState
- Returns:
- the normal on state for this field
-
hasNoDownIcon
public boolean hasNoDownIcon()- Returns:
- if this field has not got a down icon
-
hasOffsetDownIcon
public boolean hasOffsetDownIcon()- Returns:
- whether this field has a down icon as an offset of the normal icon
-
hasInvertDownIcon
public boolean hasInvertDownIcon()- Returns:
- whether this field has a down icon as an inverted image of the normal icon
-
getTextFont
- Returns:
- the text font for this field
-
getFontName
-
getTextColor
- Returns:
- the text color for this field
-
getLayerName
- Returns:
- the name of the layer
-
setCurrentScaling
public void setCurrentScaling(float scale) Set the scaling for the formObject this is only used for the locations of forms that can move such as Text Popups- Parameters:
scale
- : Current scaling to be used
-
getCurrentScaling
public float getCurrentScaling() -
setFormType
public void setFormType(int widgetType) -
getFormType
public int getFormType()look at FormFactory.LIST etc for full list of types- Returns:
- the form type
-
getOpaqueImage
- Returns:
- an Opaque BufferedImage for use when appearance Streams are null
-
setGUIComponent
-
getGUIComponent
-
getFontSize
public float getFontSize()Method to get the font size to be used in the form component This is currently only implemented for text pop-up forms- Returns:
- The base size to be used in the form component
-
getLastValidValue
used by JS to reset- Returns:
- the last valid value
-
setLastValidValue
used by JS to reset- Parameters:
value
- the last valid value to set
-
setPageRotation
public void setPageRotation(int rotation) -
setVisible
public void setVisible(boolean isVisible) -
getMatteBorderDetails
public int[] getMatteBorderDetails()Method returns matte border details of Form (not all surrounding element)- Returns:
- details of the matte border
-
setRawKids
public void setRawKids(byte[][] kidsInParent) -
getRawKids
public byte[][] getRawKids() -
setAddedToHTML
public void setAddedToHTML(boolean isAddedToHTML) Flag that element exists within HTML page content and should not be rasterized on background (but still rasterize on thumbnail)- Parameters:
isAddedToHTML
- Whether element exists within HTML page content
-
isAddedToHTML
public boolean isAddedToHTML()Check whether element exists within HTML page content and should not be rasterized on background (but still rasterize on thumbnail)- Returns:
- Whether element exists within HTML page content
-
getChoiceOptions()
for an array of pairs