setasign\SetaPDF2\FormFiller\Field

RadioButtonGroup A radio button group

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

Class hierarchy

Implements

Summary

Properties

$_buttons

$_fieldDictionary

$_fields

A reference to the fields instance

$_qualifiedName

The qualified name of the button group

$_setValueActive

protected bool RadioButtonGroup::$_setValueActive = false

A flag indicating that a setValue call is active


Methods

__construct()

public RadioButtonGroup::__construct (
\SetaPDF_FormFiller_Fields $fields,
string $qualifiedName,
\SetaPDF_Core_Type_IndirectObject $fieldObject
)

The constructor.

Parameters
$fields : \SetaPDF_FormFiller_Fields
 
$qualifiedName : string
 
$fieldObject : \SetaPDF_Core_Type_IndirectObject
 
Exceptions

Throws \setasign\SetaPDF2\Core\Type\Exception

addButton()

Add a button to the group.

Parameters
$button : \SetaPDF_FormFiller_Field_Button
 

cleanUp()

public RadioButtonGroup::cleanUp (
void
): void

Release cycled references and release memory.

See

delete()

flatten()

public RadioButtonGroup::flatten (
bool $recreateAppearanceIfNeedAppearancesIsSet = false
): void

Flatten the button group 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

getButtons()

Get all buttons of the button group.

Please note: Radio buttons and checkbox buttons are defined almost identically in the PDF format. Because of that this method returns checkbox button instances.

getDefaultButton()

Get the default checked button.

Exceptions

Throws \setasign\SetaPDF2\Core\Type\Exception

getDefaultValue()

public RadioButtonGroup::getDefaultValue (
string $encoding = 'UTF-8'
): ?string

Returns the default value of the button group.

This value is used if the form is reset

Parameters
$encoding : string
 
See

getFields()

Get the fields instance.

getName()

public RadioButtonGroup::getName (
void
): string

Alias for getQualifiedName().

See

getNoExport()

public RadioButtonGroup::getNoExport (
void
): ?bool

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

This flag is not get- or settable with Acrobat!

getOriginalQualifiedName()

Returns the original qualified name.

(which is the same as the qualified name for button groups)

getPageNumber()

getQualifiedName()

public RadioButtonGroup::getQualifiedName (
void
): string

Returns the qualified name.

getTooltip()

public RadioButtonGroup::getTooltip (
string $encoding = 'UTF-8'
): bool|string|null

Get the tooltip value.

Parameters
$encoding : string
 

getValue()

public RadioButtonGroup::getValue (
void
): ?string

Get the export value of the current active button.

This method returns the export value of the first checked button.

Exceptions

Throws \setasign\SetaPDF2\Core\Type\Exception

isReadOnly()

public RadioButtonGroup::isReadOnly (
void
): ?bool

Checks if the button group is marked as read-only.

isRequired()

public RadioButtonGroup::isRequired (
void
): ?bool

Checks if the button group is marked as required.

isSetValueActive()

public RadioButtonGroup::isSetValueActive (
void
): bool

Checks if a setValue operation is active.

onFieldDeleted()

Is called when a button in this group is deleted.

Parameters
$button : \SetaPDF_FormFiller_Field_Button
 

setDefaultValue()

public RadioButtonGroup::setDefaultValue (
string|null|\SetaPDF_FormFiller_Field_Button $value,
string $encoding = 'UTF-8'
): void

Set the default value of this button group.

Parameters
$value : string|null|\SetaPDF_FormFiller_Field_Button
 
$encoding : string
 
Exceptions

Throws \DOMException

Throws \setasign\SetaPDF2\Core\SecHandler\Exception

Throws \setasign\SetaPDF2\Core\Type\Exception

Throws \setasign\SetaPDF2\Exception

Throws \setasign\SetaPDF2\NotImplementedException

Throws \setasign\SetaPDF2\FormFiller\Exception

setNoExport()

public RadioButtonGroup::setNoExport (
bool $noExport = true
): void

Sets the "no export" flag.

This flag is not get- 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()

public RadioButtonGroup::setReadOnly (
bool $readOnly = true
): void

Sets the button group to read-only or not.

Parameters
$readOnly : bool
 

setRequired()

public RadioButtonGroup::setRequired (
bool $required = true
): void

Sets the button group to be required or not.

Parameters
$required : bool
 

setTooltip()

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

Set the tooltip value.

Parameters
$value : string|false
 
$encoding : string
 

setValue()

Set the value / active button of the button group.

This method requires the button object, which should be activated as the parameter or an export value which will be used to find the desired button.

Parameters
$value : \SetaPDF_FormFiller_Field_Button|string

The button instance or an export value

Exceptions

Throws \DOMException

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\Exception

Throws \setasign\SetaPDF2\NotImplementedException

Throws \setasign\SetaPDF2\FormFiller\Exception

Throws Exception