setasign\SetaPDF2\Core\Document\Catalog

AcroForm Class representing a basic AcroForm

File: /SetaPDF v2/Core/Document/Catalog/AcroForm.php
Old class name (alias): \SetaPDF_Core_Document_Catalog_AcroForm

Class hierarchy

Summary

Properties

$_catalog

The documents catalog instance

$_dictionary

The AcroForm dictionary


Static Methods

resolveFieldName()

public static AcroForm::resolveFieldName (
\SetaPDF_Core_Type_Dictionary $terminalFieldDictionary,
bool $asArray = false
): string|array

Resolves the qualified name of a form field.

Parameters
$terminalFieldDictionary : \SetaPDF_Core_Type_Dictionary

The terminal field of the form field

$asArray : bool
 
Return Values

In UTF-8 encoding

Exceptions

Throws \setasign\SetaPDF2\Core\Type\Exception


Methods

__construct()

The constructor.

Parameters
$catalog : \SetaPDF_Core_Document_Catalog
 

addDefaultEntriesAndValues()

public AcroForm::addDefaultEntriesAndValues (
void
): void

Add default values and resources to the AcroForm dictionary.

This is needed to avoid undefined behavior in adobe reader. If for example base fonts are missing, the file is digital signed and include links, the signature panel will never be displayed.

Exceptions

Throws \setasign\SetaPDF2\Core\SecHandler\Exception

Throws \setasign\SetaPDF2\Core\Type\Exception

cleanUp()

public AcroForm::cleanUp (
void
): void

Release cycled references.

delete()

public AcroForm::delete (
\SetaPDF_Core_Type_IndirectObject $terminalFieldObject
): bool

Deletes a field by its terminal field object.

Make sure that you only pass an object that was really resolved from this instance. There are no internal checks which validates the object content but a simple check for an FT value.

ALSO NOTE: This method will NOT remove the reference from the Annotations entry of a page but only in entries in the AcroForm structure (Fields and CO).

Parameters
$terminalFieldObject : \SetaPDF_Core_Type_IndirectObject
 
Exceptions

Throws \setasign\SetaPDF2\Core\SecHandler\Exception

Throws \setasign\SetaPDF2\Core\Type\Exception

getCalculationOrderArray()

public AcroForm::getCalculationOrderArray (
bool $create = false
): \SetaPDF_Core_Type_Array|false

Get and creates the calculation order array.

Parameters
$create : bool
 
Exceptions

Throws \setasign\SetaPDF2\Core\SecHandler\Exception

Throws \setasign\SetaPDF2\Core\Type\Exception

getDefaultResources()

public AcroForm::getDefaultResources (
bool $create = false,
null $entryKey = null
): bool|\SetaPDF_Core_Type_Dictionary

Get the default resources of the AcroForm.

Parameters
$create : bool
 
$entryKey : null
 
Exceptions

Throws \setasign\SetaPDF2\Core\SecHandler\Exception

Throws \setasign\SetaPDF2\Core\Type\Exception

getDictionary()

public AcroForm::getDictionary (
bool $create = false
): bool|\SetaPDF_Core_Type_Dictionary

Get and creates the AcroForm dictionary.

Parameters
$create : bool
 
Exceptions

Throws \setasign\SetaPDF2\Core\SecHandler\Exception

Throws \setasign\SetaPDF2\Core\Type\Exception

getDocument()

Get the document instance.

getFieldsArray()

public AcroForm::getFieldsArray (
bool $create = false
): \SetaPDF_Core_Type_Array|false

Get and creates the fields array.

Parameters
$create : bool
 
Exceptions

Throws \setasign\SetaPDF2\Core\SecHandler\Exception

Throws \setasign\SetaPDF2\Core\Type\Exception

isNeedAppearancesSet()

public AcroForm::isNeedAppearancesSet (
void
): bool

Checks if the NeedAppearances flag is set or not.

Exceptions

Throws \setasign\SetaPDF2\Core\SecHandler\Exception

Throws \setasign\SetaPDF2\Core\Type\Exception

isXfaForm()

public AcroForm::isXfaForm (
void
): bool

Checks if a XFA key is present.

Exceptions

Throws \setasign\SetaPDF2\Core\SecHandler\Exception

Throws \setasign\SetaPDF2\Core\Type\Exception

removeXfaInformation()

public AcroForm::removeXfaInformation (
void
): bool

Removes the XFA entry if present.

Exceptions

Throws \setasign\SetaPDF2\Core\SecHandler\Exception

Throws \setasign\SetaPDF2\Core\Type\Exception

setNeedAppearances()

public AcroForm::setNeedAppearances (
bool $needAppearances = true
): void

Set the NeedAppearances flag.

This flag indicates the viewer to rerender the form field appearances.

Parameters
$needAppearances : bool
 
Exceptions

Throws \setasign\SetaPDF2\Core\SecHandler\Exception

Throws \setasign\SetaPDF2\Core\Type\Exception