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
Methods
- __construct()
- _readTerminalFieldsObjects()
- addDefaultEntriesAndValues()
- addResource()
- cleanUp()
- delete()
- getCalculationOrderArray()
- getDefaultResources()
- getDictionary()
- getDocument()
- getFieldsArray()
- getTerminalFieldsObjects()
- isNeedAppearancesSet()
- isXfaForm()
- removeXfaInformation()
- setNeedAppearances()
Properties
$_catalog
The documents catalog instance
$_dictionary
The AcroForm dictionary
Static Methods
resolveFieldName()
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
Methods
__construct()
_readTerminalFieldsObjects()
?\SetaPDF_Core_Type_IndirectObjectInterface[] &$objects = null
Read all terminal fields objects.
Parameters
- $fields : ?\SetaPDF_Core_Type_Array
- $objects : ?\SetaPDF_Core_Type_IndirectObjectInterface[]
Exceptions
Throws \setasign\SetaPDF2\Core\SecHandler\Exception
Throws \setasign\SetaPDF2\Core\Type\Exception
Throws \setasign\SetaPDF2\Core\Type\IndirectReference\Exception
addDefaultEntriesAndValues()
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
addResource()
null|\SetaPDF_Core_Resource|\SetaPDF_Core_Type_IndirectObjectInterface $object = null
Adds a resource.
Parameters
- $type : string|\SetaPDF_Core_Resource
- $object : null|\SetaPDF_Core_Resource|\SetaPDF_Core_Type_IndirectObjectInterface
Exceptions
Throws \InvalidArgumentException
delete()
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
getCalculationOrderArray()
Get and creates the calculation order array.
Parameters
- $create : bool
Exceptions
getDefaultResources()
null $entryKey = null
Get the default resources of the AcroForm.
Parameters
- $create : bool
- $entryKey : null
Exceptions
getDictionary()
Get and creates the AcroForm dictionary.
Parameters
- $create : bool
Exceptions
getFieldsArray()
Get and creates the fields array.
Parameters
- $create : bool
Exceptions
getTerminalFieldsObjects()
Get the terminal fields objects of a document.
Exceptions
Throws \setasign\SetaPDF2\Core\SecHandler\Exception
Throws \setasign\SetaPDF2\Core\Type\IndirectReference\Exception
isNeedAppearancesSet()
Checks if the NeedAppearances flag is set or not.
Exceptions
isXfaForm()
removeXfaInformation()
setNeedAppearances()
Set the NeedAppearances flag.
This flag indicates the viewer to rerender the form field appearances.
Parameters
- $needAppearances : bool