setasign\SetaPDF2\FormFiller\Field
AbstractField Abstract form field
File: /SetaPDF v2/FormFiller/Field/AbstractField.php
Old class name (alias):
\SetaPDF_FormFiller_Field_AbstractField
Class hierarchy
Implements
Summary
Methods
- __construct()
- _checkPermission()
- _getAppearanceReference()
- _getBorderWidthAndStyle()
- _getFontRelation()
- _getTDictionary()
- _postDelete()
- _preDelete()
- _preFlatten()
- _recreateAppearance()
- cleanUp()
- delete()
- flatten()
- getAnnotation()
- getAppearanceCanvas()
- getAppearanceFont()
- getAppearanceFontSize()
- getAppearanceTextColor()
- getAppearanceTextColorSpace()
- getDefaultAppearanceData()
- getDefaultValue()
- getFieldDictionary()
- getFieldFlags()
- getFieldObject()
- getFields()
- getLineHeightFactor()
- getName()
- getNoExport()
- getNormalAppearanceObject()
- getOriginalQualifiedName()
- getPage()
- getPageNumber()
- getQualifiedName()
- getTooltip()
- getValue()
- isFieldFlagSet()
- isReadOnly()
- isRequired()
- recreateAppearance()
- setAppearanceFont()
- setAppearanceFontSize()
- setAppearanceTextColor()
- setAppearanceTextColorSpace()
- setDefaultValue()
- setFieldFlags()
- setLineHeightFactor()
- setNoExport()
- setReadOnly()
- setRequired()
- setTooltip()
- setValue()
- unsetFieldFlags()
Properties
$_appearanceCanvas
The canvas object of the appearance
$_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")
$_textColorSpace
An individual color space object which should be used for setting the non-stroking color space
Methods
__construct()
string $qualifiedName,
\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_IndirectObject
The indirect object holding the field dictionary (terminal field object)
- $originalQualifiedName : string
The original qualified name of the field
Exceptions
Throws \setasign\SetaPDF2\Core\Type\Exception
Throws \setasign\SetaPDF2\Core\Type\IndirectReference\Exception
_checkPermission()
Checks for form-filling permissions.
Parameters
- $permission : int
Exceptions
_getFontRelation()
Get the font relation and copy the resources to the Resources entry if needed.
Parameters
- $nDictionary : \SetaPDF_Core_Type_Dictionary
- $fontName : string
Exceptions
_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
_preFlatten()
A method called before flattening a field.
This method forwards the flatten info to the fields instance.
Exceptions
_recreateAppearance()
Recreate or creates the background appearance of the form field.
Parameters
- $circle : bool
- $canvas : ?\SetaPDF_Core_Canvas
Exceptions
delete()
Delete the field.
Exceptions
Throws Exception
Throws \setasign\SetaPDF2\Core\Type\Exception
flatten()
Flatten the field to the pages content stream.
Parameters
- $recreateAppearanceIfNeedAppearancesIsSet : bool
Defines whether the field appearance is re-created if the NeedAppearances flag is set.
Exceptions
Throws \setasign\SetaPDF2\Core\Document\ObjectNotFoundException
Throws \setasign\SetaPDF2\Core\Exception
Throws \setasign\SetaPDF2\Core\Parser\Pdf\InvalidTokenException
Throws \setasign\SetaPDF2\Core\Reader\Exception
Throws \setasign\SetaPDF2\Core\Type\Exception
Throws \setasign\SetaPDF2\Core\Type\IndirectReference\Exception
Throws \setasign\SetaPDF2\Exception
Throws \setasign\SetaPDF2\NotImplementedException
See
getAppearanceCanvas()
Get the appearance canvas of the "normal" appearance object.
Exceptions
getAppearanceFont()
Get the appearance font object.
Exceptions
Throws \setasign\SetaPDF2\Core\Exception
Throws \setasign\SetaPDF2\Core\Font\Exception
Throws \setasign\SetaPDF2\Core\Parser\Pdf\InvalidTokenException
Throws \setasign\SetaPDF2\Core\SecHandler\Exception
Throws \setasign\SetaPDF2\Core\Type\Exception
Throws \setasign\SetaPDF2\Core\Type\IndirectReference\Exception
Throws \setasign\SetaPDF2\NotImplementedException
Throws \setasign\SetaPDF2\FormFiller\Exception
Throws Exception
getAppearanceFontSize()
Get the appearance font size.
Exceptions
Throws \setasign\SetaPDF2\Core\Exception
Throws \setasign\SetaPDF2\Core\Parser\Pdf\InvalidTokenException
Throws \setasign\SetaPDF2\Core\SecHandler\Exception
Throws \setasign\SetaPDF2\Core\Type\Exception
Throws Exception
getAppearanceTextColor()
Get the individual appearance text color.
Exceptions
Throws \setasign\SetaPDF2\Core\Exception
Throws \setasign\SetaPDF2\Core\Parser\Pdf\InvalidTokenException
Throws \setasign\SetaPDF2\Core\SecHandler\Exception
Throws \setasign\SetaPDF2\Core\Type\Exception
Throws Exception
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 \setasign\SetaPDF2\Core\Exception
Throws \setasign\SetaPDF2\Core\Parser\Pdf\InvalidTokenException
Throws \setasign\SetaPDF2\Core\SecHandler\Exception
Throws \setasign\SetaPDF2\Core\Type\Exception
Throws Exception
getDefaultValue()
Returns the default value of the field.
This value is used if the form is reset
Parameters
- $encoding : string
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 \setasign\SetaPDF2\Core\Exception
Throws \setasign\SetaPDF2\Core\Font\Exception
Throws \setasign\SetaPDF2\Core\Parser\Pdf\InvalidTokenException
Throws \setasign\SetaPDF2\Core\SecHandler\Exception
Throws \setasign\SetaPDF2\Core\Type\Exception
Throws \setasign\SetaPDF2\Core\Type\IndirectReference\Exception
Throws \setasign\SetaPDF2\NotImplementedException
Throws \setasign\SetaPDF2\FormFiller\Exception
Throws Exception
See
getNormalAppearanceObject()
Get or create the normal appearance object (the object referenced in the N entry).
Parameters
- $createNew : bool
Pass true to force a recreation
Exceptions
getPage()
Gets the page object on which the form field is placed.
Exceptions
Throws \setasign\SetaPDF2\Core\Exception
Throws \setasign\SetaPDF2\Core\Type\Exception
Throws Exception
getPageNumber()
Get the page number on which the field appears.
Exceptions
Throws \setasign\SetaPDF2\Core\Document\ObjectNotDefinedException
Throws \setasign\SetaPDF2\Core\Document\ObjectNotFoundException
Throws \setasign\SetaPDF2\Core\Exception
Throws \setasign\SetaPDF2\Core\Type\Exception
Throws 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
setFieldFlags()
Sets a field flag.
Parameters
- $flags : int
- $add : ?bool
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 : ?float
See
setReadOnly()
Sets the read-only flag.
Parameters
- $readOnly : bool
Exceptions
Throws \DOMException
Throws \setasign\SetaPDF2\Core\SecHandler\Exception
Throws \setasign\SetaPDF2\Core\Type\Exception
Throws \setasign\SetaPDF2\Exception