SetaPDF_FormFiller_Field_PushButton A push button field

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

This class handles the access to a push button field.

It has no functionality but only allows you to flatten, delete or access low level properties of the field.

Class hierarchy

Implements

Summary

Properties

$_annotation

$_appearanceCanvas

The canvas object of the appearance

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

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

Get the reference to the normal appearance stream object.

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

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.

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

cleanUp()

Release cycled references and release memory.

delete()

Delete the field.

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.

getDefaultAppearanceData()

getDefaultValue()

public null SetaPDF_FormFiller_Field_PushButton::getDefaultValue ( [ string $encoding = 'UTF-8' ] )

A push button field has no default value.

Parameters
$encoding : string
 

getFieldFlags()

Returns the current field flags.

getFieldObject()

Get the indirect object of the form field.

getFields()

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

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

Parameters
$createNew : boolean

Pass true to force a recreation

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 bool|string SetaPDF_FormFiller_Field_AbstractField::getTooltip ( [ string $encoding = 'UTF-8' ] )

Get the tooltip value.

Parameters
$encoding : string
 

getValue()

public null|SetaPDF_Core_Type_Dictionary SetaPDF_FormFiller_Field_PushButton::getValue ( [ string $encoding = 'UTF-8' ] )

A push button field has no value.

Parameters
$encoding : string
 

isFieldFlagSet()

public boolean SetaPDF_FormFiller_Field_AbstractField::isFieldFlagSet ( integer $flag )

Checks if a specific field flag is set.

Parameters
$flag : integer
 

isReadOnly()

Checks if the field is set to read-only.

isRequired()

Checks if the field is set to be required.

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

Set an individual font size.

Parameters
$fontSize : float|null
 

setAppearanceTextColor()

Set an individual appearance text color.

Parameters
$textColor : SetaPDF_Core_DataStructure_Color
 

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
 

unsetFieldFlags()

Removes a field flag.

Parameters
$flags : integer