SetaPDF_FormFiller_Field_Button A checkbox button

File: /SetaPDF/FormFiller/Field/Button.php

Class hierarchy

Implements

Summary

Properties

$_annotation

$_appearanceCanvas

The canvas object of the appearance

$_buttonGroup

The button group object to which this button is attached to (if so)

$_fieldDictionary

$_fieldObject

$_fields

A reference to the fields instance

$_font

The font object, which should be used to create the appearance

$_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

$_page

The page instance on which the form field is placed

$_qualifiedName

The name including a suffix if needed ("Text#1")

$_textColor

An individual color object which should be used for drawing the text appearance


Methods

__construct()

public SetaPDF_FormFiller_Field_AbstractField::__construct ( SetaPDF_FormFiller_Fields $fields, string $qualifiedName, SetaPDF_Core_Type_IndirectReference|SetaPDF_Core_Type_IndirectObject $fieldObject [, string $originalQualifiedName = null ] )

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

The indirect object or reference holding the field dictionary

$originalQualifiedName : string

The original qualified name of the field

_checkPermission()

protected void SetaPDF_FormFiller_Field_AbstractField::_checkPermission ( [ integer $permission = \SetaPDF_Core_SecHandler::PERM_FILL_FORM ] )

Checks for form-filling permissions.

Parameters
$permission : integer
 
Exceptions

Throws SetaPDF_Core_SecHandler_Exception

_getAppearanceReference()

protected SetaPDF_Core_Type_IndirectObject|false SetaPDF_FormFiller_Field_Button::_getAppearanceReference ( void )

Get the appearance reference of the current state.

See

_getFontRelation()

protected SetaPDF_Core_Type_Dictionary_Entry SetaPDF_FormFiller_Field_AbstractField::_getFontRelation ( SetaPDF_Core_Type_Dictionary $nDictionary, string &$fontName )

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()

protected void SetaPDF_FormFiller_Field_Button::_postDelete ( void )

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()

protected void SetaPDF_FormFiller_Field_AbstractField::_preDelete ( void )

A method called before deleting a field.

This method forwards the deletion info to the fields instance.

_preFlatten()

protected void SetaPDF_FormFiller_Field_AbstractField::_preFlatten ( void )

A method called before flattening a field.

This method forwards the flatten info to the fields instance.

_recreateAppearance()

protected SetaPDF_Core_Canvas SetaPDF_FormFiller_Field_AbstractField::_recreateAppearance ( void )

Recreate or creates the background appearance of the form field.

check()

public void SetaPDF_FormFiller_Field_Button::check ( void )

Checks the button.

cleanUp()

public void SetaPDF_FormFiller_Field_AbstractField::cleanUp ( void )

Release cycled references and release memory.

delete()

public void SetaPDF_FormFiller_Field_AbstractField::delete ( void )

Delete the field.

flatten()

public void SetaPDF_FormFiller_Field_AbstractField::flatten ( void )

Flatten the field to the pages content stream.

See

getAnnotation()

public SetaPDF_Core_Document_Page_Annotation_Widget SetaPDF_FormFiller_Field_AbstractField::getAnnotation ( void )

Get the widget annotation object from this field.

getAppearanceCanvas()

public SetaPDF_Core_Canvas SetaPDF_FormFiller_Field_AbstractField::getAppearanceCanvas ( void )

Get the appearance canvas of the "normal" appearance object.

getAppearanceFont()

public null|SetaPDF_Core_Font SetaPDF_FormFiller_Field_AbstractField::getAppearanceFont ( void )

Get the appearance font object.

getAppearanceFontSize()

public float|null SetaPDF_FormFiller_Field_AbstractField::getAppearanceFontSize ( void )

Get the appearance font size.

Exceptions

Throws SetaPDF_FormFiller_Field_Exception

getAppearanceTextColor()

public null|SetaPDF_Core_DataStructure_Color SetaPDF_FormFiller_Field_AbstractField::getAppearanceTextColor ( void )

Get the individual appearance text color.

getDefaultAppearanceData()

public SetaPDF_FormFiller_Field_DefaultAppearanceData SetaPDF_FormFiller_Field_AbstractField::getDefaultAppearanceData ( void )

Get the default appearance data of the DA value.

Exceptions

Throws SetaPDF_FormFiller_Field_Exception

getDefaultValue()

public mixed SetaPDF_FormFiller_Field_Button::getDefaultValue ( [ string $encoding = 'UTF-8' ] )

Get the default value (DV entry or value in the Opt array) of the field.

Parameters
$encoding : string
 
See

getExportValue()

public string SetaPDF_FormFiller_Field_Button::getExportValue ( [ string $encoding = 'UTF-8' ] )

Returns the export value of the button.

Parameters
$encoding : string
 

getFieldDictionary()

public SetaPDF_Core_Type_AbstractType|SetaPDF_Core_Type_Dictionary SetaPDF_FormFiller_Field_AbstractField::getFieldDictionary ( void )

Get the field dictionary.

getFieldFlags()

public integer SetaPDF_FormFiller_Field_AbstractField::getFieldFlags ( void )

Returns the current field flags.

getFieldObject()

public SetaPDF_Core_Type_IndirectObject SetaPDF_FormFiller_Field_AbstractField::getFieldObject ( void )

Get the indirect object of the form field.

getFields()

public SetaPDF_FormFiller_Fields SetaPDF_FormFiller_Field_AbstractField::getFields ( void )

Get the fields instance.

getLineHeightFactor()

public float SetaPDF_FormFiller_Field_AbstractField::getLineHeightFactor ( void )

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

getName()

public string SetaPDF_FormFiller_Field_AbstractField::getName ( void )

Alias for getQualifiedName().

See

getNoExport()

public boolean SetaPDF_FormFiller_Field_AbstractField::getNoExport ( void )

Checks if the no-export flag is set.

getNormalAppearanceObject()

public SetaPDF_Core_Type_IndirectObject SetaPDF_FormFiller_Field_Button::getNormalAppearanceObject ( [ boolean $createNew = false [, boolean $state = false ]] )

Get or create the normal appearance object (the object referenced in the N entry).

Parameters
$createNew : boolean

Pass true to force a recreation

$state : boolean

False for the "Off" state. True for the checked state.

getOnStateName()

public string SetaPDF_FormFiller_Field_Button::getOnStateName ( void )

Resolves the key/name for the "On"-state of the button.

getOriginalQualifiedName()

public string SetaPDF_FormFiller_Field_AbstractField::getOriginalQualifiedName ( void )

Get the original qualified name (without suffix).

getPage()

public SetaPDF_Core_Document_Page SetaPDF_FormFiller_Field_AbstractField::getPage ( void )

Gets the page object on which the form field is placed.

Exceptions

Throws SetaPDF_FormFiller_Field_Exception

getPageNumber()

public integer SetaPDF_FormFiller_Field_AbstractField::getPageNumber ( void )

Get the page number on which the field appears.

getQualifiedName()

public string SetaPDF_FormFiller_Field_AbstractField::getQualifiedName ( void )

Returns the qualified name.

getTooltip()

public bool|string SetaPDF_FormFiller_Field_AbstractField::getTooltip ( [ string $encoding = 'UTF-8' ] )

Get the tooltip value.

Parameters
$encoding : string
 

getValue()

public boolean SetaPDF_FormFiller_Field_Button::getValue ( void )

Gets whether the button is checked or not.

See

isChecked()

public boolean SetaPDF_FormFiller_Field_Button::isChecked ( void )

Gets whether the button is checked or not.

isFieldFlagSet()

public boolean SetaPDF_FormFiller_Field_AbstractField::isFieldFlagSet ( integer $flag )

Checks if a specific field flag is set.

Parameters
$flag : integer
 

isReadOnly()

public boolean SetaPDF_FormFiller_Field_AbstractField::isReadOnly ( void )

Checks if the field is set to read-only.

isRequired()

public boolean SetaPDF_FormFiller_Field_AbstractField::isRequired ( void )

Checks if the field is set to be required.

pull()

public void SetaPDF_FormFiller_Field_Button::pull ( void )

Alias for uncheck().

See

push()

public void SetaPDF_FormFiller_Field_Button::push ( void )

Alias for check().

See

setAppearanceFont()

public void SetaPDF_FormFiller_Field_AbstractField::setAppearanceFont ( SetaPDF_Core_Font $font [, float $size = null ] )

Set the appearance font object.

Parameters
$font : SetaPDF_Core_Font
 
$size : float
 

setAppearanceFontSize()

public void SetaPDF_FormFiller_Field_AbstractField::setAppearanceFontSize ( float|null $fontSize )

Set an individual font size.

Parameters
$fontSize : float|null
 

setAppearanceTextColor()

public void SetaPDF_FormFiller_Field_AbstractField::setAppearanceTextColor ( [ SetaPDF_Core_DataStructure_Color $textColor = null ] )

Set an individual appearance text color.

Parameters
$textColor : SetaPDF_Core_DataStructure_Color
 

setButtonGroup()

public void SetaPDF_FormFiller_Field_Button::setButtonGroup ( SetaPDF_FormFiller_Field_ButtonGroup $buttonGroup )

Set the button group to which this button is attached to.

Parameters
$buttonGroup : SetaPDF_FormFiller_Field_ButtonGroup
 
See

setDefaultValue()

public void SetaPDF_FormFiller_Field_Button::setDefaultValue ( boolean|string $value [, string $encoding = 'UTF-8' ] )

Set the default value of the field.

Parameters
$value : boolean|string
 
$encoding : string
 

setFieldFlags()

public void SetaPDF_FormFiller_Field_AbstractField::setFieldFlags ( integer $flags [, boolean|null $add = true ] )

Sets a field flag.

Parameters
$flags : integer
 
$add : boolean|null

Add = true, remove = false, set = null

setLineHeightFactor()

public void SetaPDF_FormFiller_Field_AbstractField::setLineHeightFactor ( null|float $lineHeightFactor )

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

setNoExport()

public void SetaPDF_FormFiller_Field_AbstractField::setNoExport ( [ boolean $noExport = true ] )

Set the no-export flag.

Parameters
$noExport : boolean
 

setReadOnly()

public void SetaPDF_FormFiller_Field_AbstractField::setReadOnly ( [ boolean $readOnly = true ] )

Sets the read-only flag.

Parameters
$readOnly : boolean
 

setRequired()

public void SetaPDF_FormFiller_Field_AbstractField::setRequired ( [ boolean $required = true ] )

Sets the required flag.

Parameters
$required : boolean
 

setTooltip()

public void SetaPDF_FormFiller_Field_AbstractField::setTooltip ( string|false $value [, string $encoding = 'UTF-8' ] )

Set the tooltip value.

Parameters
$value : string|false
 
$encoding : string
 

setValue()

public void SetaPDF_FormFiller_Field_Button::setValue ( boolean|string $value [, string $encoding = 'UTF-8' ] )

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

uncheck()

public void SetaPDF_FormFiller_Field_Button::uncheck ( void )

Uncheck the button.

unsetFieldFlags()

public void SetaPDF_FormFiller_Field_AbstractField::unsetFieldFlags ( integer $flags )

Removes a field flag.

Parameters
$flags : integer