SetaPDF_FormFiller_Field_Button A checkbox button
File: /SetaPDF v2/FormFiller/Field/Button.php
Class hierarchy
Implements
Summary
Methods
- __construct()
- _checkPermission()
- _getAppearanceReference()
- _getBorderWidthAndStyle()
- _getFontRelation()
- _hasAppearance()
- _postDelete()
- _preDelete()
- _preFlatten()
- _recreateAppearance()
- check()
- cleanUp()
- delete()
- flatten()
- getAnnotation()
- getAppearanceCanvas()
- getAppearanceFont()
- getAppearanceFontSize()
- getAppearanceTextColor()
- getAppearanceTextColorSpace()
- getDefaultAppearanceData()
- getDefaultValue()
- getExportValue()
- getFieldDictionary()
- getFieldFlags()
- getFieldObject()
- getFields()
- getLineHeightFactor()
- getName()
- getNoExport()
- getNormalAppearanceObject()
- getOnStateName()
- getOriginalQualifiedName()
- getPage()
- getPageNumber()
- getQualifiedName()
- getTooltip()
- getValue()
- isChecked()
- isFieldFlagSet()
- isReadOnly()
- isRequired()
- pull()
- push()
- setAppearanceFont()
- setAppearanceFontSize()
- setAppearanceTextColor()
- setAppearanceTextColorSpace()
- setButtonGroup()
- setDefaultValue()
- setFieldFlags()
- setLineHeightFactor()
- setNoExport()
- setReadOnly()
- setRequired()
- setTooltip()
- setValue()
- uncheck()
- 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
$_onStateName
The key/name for the "On"-state of the button
$_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_IndirectReference|SetaPDF_Core_Type_IndirectObject
- $originalQualifiedName : string
The original qualified name of the field
_checkPermission()
Checks for form-filling permissions.
Parameters
- $permission : integer
Exceptions
_getAppearanceReference()
Get the appearance reference of the current state.
See
_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_FormFiller_Exception
_postDelete()
This method is automatically called after the field is deleted.
It makes sure, that a related button group will be notified if the button is deleted, so it is able to update its button collection.
See
_preDelete()
A method called before deleting a field.
This method forwards the deletion info to the fields instance.
_preFlatten()
A method called before flattening a field.
This method forwards the flatten info to the fields instance.
_recreateAppearance()
Recreate or creates the background appearance of the form field.
Parameters
- $circle : null|SetaPDF_Core_Canvas
- $canvas
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_Type_Exception
Throws SetaPDF_Core_Type_IndirectReference_Exception
See
getAnnotation()
Get the widget annotation object from this field.
getAppearanceFont()
Get the appearance font object.
getAppearanceTextColor()
Get the individual appearance text color.
getAppearanceTextColorSpace()
Get the individual color space object which should be used for setting the non-stroking color space.
getDefaultAppearanceData()
Get the default appearance data of the DA value.
Exceptions
getDefaultValue()
Get the default value (DV entry or value in the Opt array) of the field.
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".
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
getTooltip()
Get the tooltip value.
Parameters
- $encoding : string
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
setButtonGroup()
Set the button group to which this button is attached to.
Parameters
- $buttonGroup : SetaPDF_FormFiller_Field_ButtonGroup
See
setDefaultValue()
Set the default value of the field.
Parameters
- $value : boolean|string
- $encoding : string
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
setTooltip()
Set the tooltip value.
Parameters
- $value : string|false
- $encoding : string
setValue()
Check or un-check the button.
Parameters
- $value : boolean|string
The value can be a boolean value or a value that will be compared to the export value to evaluate to a boolean whether to check or un-check the check box.
- $encoding : string
The input encoding if $value is a string