SetaPDF_FormFiller_Field_Button A checkbox button

File: /SetaPDF v2/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

$_textColorSpace

An individual color space object which should be used for setting the non-stroking color space


Methods

__construct()

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

The constructor.

Parameters
$fields : SetaPDF_FormFiller_Fields

The fields instance

$qualifiedName

The qualified name of the field

$fieldObject
 
$originalQualifiedName

The original qualified name of the field

_checkPermission()

Checks for form-filling permissions.

Parameters
$permission
 
Exceptions

Throws SetaPDF_Core_SecHandler_Exception

_getAppearanceReference()

_getBorderWidthAndStyle()

Resolve the border width and style

_getFontRelation()

Get the font relation and copy the resources to the Resources entry if needed.

Parameters
$nDictionary : SetaPDF_Core_Type_Dictionary
 
$fontName
 
Exceptions

Throws SetaPDF_FormFiller_Exception

_hasAppearance()

Checks whether an default appearance for the current state exists.

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

protected SetaPDF_FormFiller_Field_AbstractField::_recreateAppearance (
[ $circle = false [, $canvas = null ]]
):

Recreate or creates the background appearance of the form field.

Parameters
$circle
 
$canvas
 

check()

Checks the button.

cleanUp()

Release cycled references and release memory.

delete()

Delete the field.

Exceptions

Throws SetaPDF_FormFiller_Field_Exception

flatten()

Flatten the field to the pages content stream.

See

getAnnotation()

Get the widget annotation object from this field.

getAppearanceCanvas()

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

getAppearanceFont()

Get the appearance font object.

getAppearanceFontSize()

Get the appearance font size.

Exceptions

Throws SetaPDF_FormFiller_Field_Exception

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

Throws SetaPDF_FormFiller_Field_Exception

getDefaultValue()

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

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

Parameters
$encoding
 
See

getExportValue()

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

Returns the export value of the button.

Parameters
$encoding
 

getFieldDictionary()

Get the field dictionary.

getFieldFlags()

Returns the current field flags.

getFieldObject()

Get the indirect object of the form field.

getFields()

Get the fields instance.

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

getNoExport()

Checks if the no-export flag is set.

getNormalAppearanceObject()

public SetaPDF_FormFiller_Field_Button::getNormalAppearanceObject (
[ $createNew = false ]
):

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

Parameters
$createNew

Pass true to force a recreation

getOnStateName()

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

getOriginalQualifiedName()

Get the original qualified name (without suffix).

getPage()

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

Exceptions

Throws SetaPDF_FormFiller_Field_Exception

getPageNumber()

Get the page number on which the field appears.

getQualifiedName()

Returns the qualified name.

getTooltip()

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

Get the tooltip value.

Parameters
$encoding
 

getValue()

Gets whether the button is checked or not.

See

isChecked()

Gets whether the button is checked or not.

isFieldFlagSet()

Checks if a specific field flag is set.

Parameters
$flag
 

isReadOnly()

Checks if the field is set to read-only.

isRequired()

Checks if the field is set to be required.

pull()

push()

setAppearanceFont()

Set the appearance font object.

Parameters
$font : SetaPDF_Core_Font_FontInterface
 
$size
 

setAppearanceFontSize()

Set an individual font size.

Parameters
$fontSize
 

setAppearanceTextColor()

Set an individual appearance text color.

Parameters
$textColor : SetaPDF_Core_DataStructure_Color|null
 

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

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

Set the default value of the field.

Parameters
$value
 
$encoding
 

setFieldFlags()

public SetaPDF_FormFiller_Field_AbstractField::setFieldFlags (
$flags [, $add = true ]
): void

Sets a field flag.

Parameters
$flags
 
$add

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
 
See

setNoExport()

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

Set the no-export flag.

Parameters
$noExport
 

setReadOnly()

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

Sets the read-only flag.

Parameters
$readOnly
 

setRequired()

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

Sets the required flag.

Parameters
$required
 

setTooltip()

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

Set the tooltip value.

Parameters
$value
 
$encoding
 

setValue()

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

Check or un-check the button.

Parameters
$value

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

The input encoding if $value is a string

uncheck()

Uncheck the button.

unsetFieldFlags()

Removes a field flag.

Parameters
$flags