SetaPDF_FormFiller_Field_Combo A combo box
File: /SetaPDF v2/FormFiller/Field/Combo.php
Class hierarchy
Implements
Summary
Methods
- __construct()
- _checkPermission()
- _getAppearanceReference()
- _getBorderWidthAndStyle()
- _getFontRelation()
- _getTDictionary()
- _postDelete()
- _preDelete()
- _preFlatten()
- _recreateAppearance()
- cleanUp()
- delete()
- flatten()
- getAdditionalActions()
- getAnnotation()
- getAppearanceCanvas()
- getAppearanceFont()
- getAppearanceFontSize()
- getAppearanceTextColor()
- getAppearanceTextColorSpace()
- getAppearanceValue()
- getDefaultAppearanceData()
- getDefaultValue()
- getFieldDictionary()
- getFieldFlags()
- getFieldObject()
- getFields()
- getLineHeightFactor()
- getName()
- getNoExport()
- getNormalAppearanceObject()
- getOptions()
- getOriginalQualifiedName()
- getPage()
- getPageNumber()
- getQualifiedName()
- getTooltip()
- getValue()
- getVisibleValue()
- isEditable()
- isFieldFlagSet()
- isReadOnly()
- isRequired()
- recreateAppearance()
- setAppearanceFont()
- setAppearanceFontSize()
- setAppearanceTextColor()
- setAppearanceTextColorSpace()
- setAppearanceValueCallback()
- setDefaultValue()
- setEditable()
- setFieldFlags()
- setLineHeightFactor()
- setNoExport()
- setReadOnly()
- setRequired()
- setTooltip()
- setValue()
- unsetFieldFlags()
Properties
$_annotation
The annotation object of this form field
$_fontSize
The font size, which should be used to create the appearance
$_lineHeightFactor
The factor to calculate the line height based on the font size
$_originalQualifiedName
The name without the suffix
$_qualifiedName
The name including a suffix if needed ("Text#1")
$_textColorSpace
An individual color space object which should be used for setting the non-stroking color space
Methods
__construct()
The constructor.
Parameters
- $fields : SetaPDF_FormFiller_Fields
The fields instance
- $qualifiedName : string
The qualified name of the field
- $fieldObject : SetaPDF_Core_Type_IndirectObject
The indirect object holding the field dictionary (terminal field object)
- $originalQualifiedName : string
The original qualified name of the field
Exceptions
Throws SetaPDF_Core_Type_Exception
_checkPermission()
Checks for form-filling permissions.
Parameters
- $permission : integer
Exceptions
_getAppearanceReference()
Get the reference to the normal appearance stream object.
_getBorderWidthAndStyle()
_getFontRelation()
Get the font relation and copy the resources to the Resources entry if needed.
Parameters
- $nDictionary : SetaPDF_Core_Type_Dictionary
- $fontName : string
Exceptions
Throws SetaPDF_Core_SecHandler_Exception
Throws SetaPDF_Core_Type_Exception
_getTDictionary()
Get the dictionary that holds the last "T" entry.
_postDelete()
A method called after deleting a field.
This method forwards the deletion info to the fields instance.
_preDelete()
A method called before deleting a field.
This method forwards the deletion info to the fields instance.
Exceptions
Throws SetaPDF_Core_SecHandler_Exception
Throws SetaPDF_Core_Type_Exception
_preFlatten()
A method called before flattening a field.
This method forwards the flatten info to the fields instance.
Exceptions
Throws SetaPDF_Core_SecHandler_Exception
Throws SetaPDF_Core_Type_Exception
_recreateAppearance()
Recreate or creates the background appearance of the form field.
Parameters
- $circle : bool
- $canvas : null|SetaPDF_Core_Canvas
Exceptions
Throws SetaPDF_Core_Type_Exception
delete()
Delete the field.
Exceptions
Throws SetaPDF_FormFiller_Field_Exception
Throws SetaPDF_Core_Type_Exception
Throws SetaPDF_Core_SecHandler_Exception
Throws SetaPDF_Core_Exception
flatten()
Flatten the field to the pages content stream.
Parameters
- $recreateAppearanceIfNeedAppearancesIsSet : boolean
Defines whether the field appearance is re-created if the NeedAppearances flag is set.
Exceptions
Throws SetaPDF_Core_Document_ObjectNotFoundException
Throws SetaPDF_Core_Exception
Throws SetaPDF_Core_Parser_Pdf_InvalidTokenException
Throws SetaPDF_Core_Reader_Exception
Throws SetaPDF_Core_Type_Exception
Throws SetaPDF_Core_Type_IndirectReference_Exception
Throws SetaPDF_Exception
Throws SetaPDF_Exception_NotImplemented
See
getAdditionalActions()
Gets the additional actions object instance for this field.
getAnnotation()
Get the widget annotation object from this field.
Exceptions
Throws SetaPDF_Core_Type_Exception
getAppearanceCanvas()
Get the appearance canvas of the "normal" appearance object.
Exceptions
Throws SetaPDF_Core_Type_Exception
getAppearanceFont()
Get the appearance font object.
Exceptions
Throws SetaPDF_Core_Exception
Throws SetaPDF_Core_Font_Exception
Throws SetaPDF_Core_Parser_Pdf_InvalidTokenException
Throws SetaPDF_Core_SecHandler_Exception
Throws SetaPDF_Core_Type_Exception
Throws SetaPDF_Core_Type_IndirectReference_Exception
Throws SetaPDF_Exception_NotImplemented
Throws SetaPDF_FormFiller_Exception
getAppearanceFontSize()
Get the appearance font size.
Exceptions
Throws SetaPDF_Core_Exception
Throws SetaPDF_Core_Parser_Pdf_InvalidTokenException
Throws SetaPDF_Core_SecHandler_Exception
Throws SetaPDF_Core_Type_Exception
getAppearanceTextColor()
Get the individual appearance text color.
Exceptions
Throws SetaPDF_Core_Exception
Throws SetaPDF_Core_Parser_Pdf_InvalidTokenException
Throws SetaPDF_Core_SecHandler_Exception
Throws SetaPDF_Core_Type_Exception
getAppearanceTextColorSpace()
Get the individual color space object which should be used for setting the non-stroking color space.
getAppearanceValue()
Get the appearance value.
Parameters
- $encoding : string
Exceptions
Throws SetaPDF_Core_Document_ObjectNotFoundException
Throws SetaPDF_Core_Exception
Throws SetaPDF_Core_Parser_Pdf_InvalidTokenException
Throws SetaPDF_Core_Reader_Exception
Throws SetaPDF_Core_Type_Exception
Throws SetaPDF_Core_Type_IndirectReference_Exception
Throws SetaPDF_Exception
getDefaultAppearanceData()
Get the default appearance data of the DA value.
Exceptions
Throws SetaPDF_Core_Exception
Throws SetaPDF_Core_Parser_Pdf_InvalidTokenException
Throws SetaPDF_Core_SecHandler_Exception
Throws SetaPDF_Core_Type_Exception
getDefaultValue()
Returns the default value of the field.
This value is used if the form is reset
Parameters
- $encoding : string
See
getFieldDictionary()
Get the field dictionary.
getFieldObject()
Get the indirect object of the form field.
getLineHeightFactor()
Get the line height factor
The line height is calculated by this factor in relation to the font size:
$lineHeight = $fontSize * $lineHeightFactor
By default, this value is calculated by the font bounding box values "ury - lly / 1000".
Exceptions
Throws SetaPDF_Core_Exception
Throws SetaPDF_Core_Font_Exception
Throws SetaPDF_Core_Parser_Pdf_InvalidTokenException
Throws SetaPDF_Core_SecHandler_Exception
Throws SetaPDF_Core_Type_Exception
Throws SetaPDF_Core_Type_IndirectReference_Exception
Throws SetaPDF_Exception_NotImplemented
Throws SetaPDF_FormFiller_Exception
Throws SetaPDF_FormFiller_Field_Exception
See
getNormalAppearanceObject()
Get or create the normal appearance object (the object referenced in the N entry).
Parameters
- $createNew : boolean
Pass true to force a recreation
Exceptions
Throws SetaPDF_Core_Type_Exception
getOptions()
Get the options and the export values.
Parameters
- $encoding : string
The output encoding
Return Values
An array of arrays with following keys: visibleValue and exportValue
Exceptions
Throws SetaPDF_Core_Type_Exception
getPage()
Gets the page object on which the form field is placed.
Exceptions
Throws SetaPDF_Core_Exception
Throws SetaPDF_Core_Type_Exception
getPageNumber()
Get the page number on which the field appears.
Exceptions
Throws SetaPDF_Core_Document_ObjectNotDefinedException
Throws SetaPDF_Core_Document_ObjectNotFoundException
Throws SetaPDF_Core_Exception
Throws SetaPDF_Core_Type_Exception
getTooltip()
Get the tooltip value.
Parameters
- $encoding : string
getValue()
Get the current value
Parameters
- $encoding : string
The output encoding
Return Values
If no value is selected null will be returned otherwise a string.
getVisibleValue()
Get the visible value of the current selected option
Parameters
- $encoding : string
Exceptions
Throws SetaPDF_Core_Type_Exception
recreateAppearance()
Recreate or creates the appearance of the form field
Exceptions
Throws SetaPDF_Core_Document_ObjectNotFoundException
Throws SetaPDF_Core_Exception
Throws SetaPDF_Core_Font_Exception
Throws SetaPDF_Core_Parser_Pdf_InvalidTokenException
Throws SetaPDF_Core_Reader_Exception
Throws SetaPDF_Core_SecHandler_Exception
Throws SetaPDF_Core_Type_Exception
Throws SetaPDF_Core_Type_IndirectReference_Exception
Throws SetaPDF_Exception
Throws SetaPDF_Exception_NotImplemented
Throws SetaPDF_FormFiller_Exception
setAppearanceFont()
Set the appearance font object.
Parameters
- $font : SetaPDF_Core_Font_FontInterface
- $size : float
setAppearanceTextColor()
Set an individual appearance text color.
Parameters
- $textColor : SetaPDF_Core_DataStructure_Color
setAppearanceTextColorSpace()
Set the individual color space object which should be used for setting the non-stroking color space.
Parameters
- $colorSpace : SetaPDF_Core_ColorSpace|null
setAppearanceValueCallback()
Set the appearance value callback (to e.g. format a number).
The callback will be called with 2 arguments:
- A reference to the field instance
- The requested encoding
It needs to return a value in the specified encoding (internal calls need UTF-16BE throughout).
Parameters
- $callback : callback
setDefaultValue()
Set the default value of the field.
Parameters
- $value : null|string|int
- $encoding : string
Exceptions
Throws SetaPDF_Core_SecHandler_Exception
Throws SetaPDF_Core_Type_Exception
Throws SetaPDF_Core_Type_IndirectReference_Exception
Throws SetaPDF_FormFiller_Exception
setEditable()
Sets if the combo box shall include an editable text box as well to a drop-down list
Parameters
- $editable : boolean
- $setDefaultValue : boolean
Exceptions
Throws SetaPDF_Core_Document_ObjectNotFoundException
Throws SetaPDF_Core_Exception
Throws SetaPDF_Core_Font_Exception
Throws SetaPDF_Core_Parser_Pdf_InvalidTokenException
Throws SetaPDF_Core_Reader_Exception
Throws SetaPDF_Core_SecHandler_Exception
Throws SetaPDF_Core_Type_Exception
Throws SetaPDF_Core_Type_IndirectReference_Exception
Throws SetaPDF_Exception
Throws SetaPDF_Exception_NotImplemented
Throws SetaPDF_FormFiller_Exception
setFieldFlags()
Sets a field flag.
Parameters
- $flags : integer
- $add : boolean|null
Add = true, remove = false, set = null
setLineHeightFactor()
Set the line height factor
The line height is calculated by this factor in relation to the font size:
$lineHeight = $fontSize * $lineHeightFactor
By default, this value is calculated by the font bounding box values "ury - lly / 1000".
Parameters
- $lineHeightFactor : null|float
See
setReadOnly()
Sets the read-only flag.
Parameters
- $readOnly : boolean
Exceptions
Throws DOMException
Throws SetaPDF_Core_SecHandler_Exception
Throws SetaPDF_Core_Type_Exception
Throws SetaPDF_Exception
Throws SetaPDF_Exception_NotImplemented
Throws SetaPDF_FormFiller_Exception
setTooltip()
Set the tooltip value.
Parameters
- $value : string|false
- $encoding : string
setValue()
Set the fields value / Selects the option
The value could be an export value of an option or the numeric index of an option, received by getOptions(). If the field is marked as an editable text field, it is also possible to pass a string.
Parameters
- $value : string|integer
- $encoding : string
Exceptions
Throws SetaPDF_Core_Document_ObjectNotFoundException
Throws SetaPDF_Core_Exception
Throws SetaPDF_Core_Font_Exception
Throws SetaPDF_Core_Parser_Pdf_InvalidTokenException
Throws SetaPDF_Core_Reader_Exception
Throws SetaPDF_Core_SecHandler_Exception
Throws SetaPDF_Core_Type_Exception
Throws SetaPDF_Core_Type_IndirectReference_Exception
Throws SetaPDF_Exception
Throws SetaPDF_Exception_NotImplemented
Throws SetaPDF_FormFiller_Exception