setasign\SetaPDF2\FormFiller\Field

AppearanceValueCallbackInterface Field appearance callback interface

File: /SetaPDF v2/FormFiller/Field/AppearanceValueCallbackInterface.php
Old class name (alias): \SetaPDF_FormFiller_Field_AppearanceValueCallbackInterface

Implemented in

Implements

Summary

Methods

cleanUp()

abstract public FieldInterface::cleanUp (
void
): void

Release cycled references and release memory.

delete()

abstract public FieldInterface::delete (
void
): void

Delete the form field.

flatten()

abstract public FieldInterface::flatten (
bool $recreateAppearanceIfNeedAppearancesIsSet = false
): void

Flatten the form fields appearance to the pages content.

Parameters
$recreateAppearanceIfNeedAppearancesIsSet : bool

Defines whether the field appearance is re-created if the NeedAppearances flag is set.

getAppearanceValue()

abstract public AppearanceValueCallbackInterface::getAppearanceValue (
string $encoding = 'UTF-8'
): string

Get the appearance value.

Parameters
$encoding : string
 

getDefaultValue()

abstract public FieldInterface::getDefaultValue (
string $encoding = 'UTF-8'
): mixed

Returns the default value of the field.

This value is used if the form is reset

Parameters
$encoding : string
 

getFieldDictionary()

Get the field dictionary.

getNoExport()

abstract public FieldInterface::getNoExport (
void
): bool

Get the info, if the field is marked as "no export".

This flag is not gettable or settable with Acrobat!

getOriginalQualifiedName()

abstract public FieldInterface::getOriginalQualifiedName (
void
): string

Returns the original qualified name of the field (without suffix #n).

getQualifiedName()

abstract public FieldInterface::getQualifiedName (
void
): string

Returns the qualified name of the field.

getValue()

abstract public FieldInterface::getValue (
void
): mixed

Returns the field specific value.

getVisibleValue()

abstract public AppearanceValueCallbackInterface::getVisibleValue (
string $encoding = 'UTF-8'
): mixed

Returns the field specific visible value.

This value is used for e.g. formatting while the real export value may be a different one (for e.g. combo boxes).

Parameters
$encoding : string
 

isReadOnly()

abstract public FieldInterface::isReadOnly (
void
): bool

Checks if a field is marked as read-only.

isRequired()

abstract public FieldInterface::isRequired (
void
): bool

Checks if a field is marked as required.

recreateAppearance()

abstract public FieldInterface::recreateAppearance (
void
): void

Recreate or creates the appearance of the form field if needed.

setAppearanceTextColor()

Set an individual appearance text color.

Parameters
$textColor : ?\SetaPDF_Core_DataStructure_Color
 

setAppearanceValueCallback()

abstract public AppearanceValueCallbackInterface::setAppearanceValueCallback (
callback $callback
): void

Set the appearance value callback (to e.g. format a number).

The callback will be called with 2 arguments:

  1. A reference to the field instance
  2. The requested encoding

It needs to return a value in the specified encoding (internal calls need UTF-16BE throughout).

Parameters
$callback : callback
 

setDefaultValue()

abstract public FieldInterface::setDefaultValue (
mixed $value,
string $encoding = 'UTF-8'
): void

Set the default value of the field.

Parameters
$value : mixed
 
$encoding : string
 

setNoExport()

abstract public FieldInterface::setNoExport (
bool $noExport = true
): void

Sets the "no export" flag.

This flag is not gettable or settable with Acrobat!

If you remove this flag, the element could be still not exported due to a definition in a FormSubmit actions Fields array.

Parameters
$noExport : bool
 

setReadOnly()

abstract public FieldInterface::setReadOnly (
bool $readOnly = true
): void

Sets a field to read-only or not.

Parameters
$readOnly : bool
 

setRequired()

abstract public FieldInterface::setRequired (
bool $required = true
): void

Sets a field to be required or not.

Parameters
$required : bool
 

setValue()

abstract public FieldInterface::setValue (
mixed $value
): void

Sets the fields value.

Parameters
$value : mixed