setasign\SetaPDF2\FormFiller\Field\FlattenTaggingHandler
TagAsFigureHandler Tags a flattened field as a Figure
File: /SetaPDF v2/FormFiller/Field/FlattenTaggingHandler/TagAsFigureHandler.php
This tagging handler can be used if the flattened field will display an image/a figure. The layout bounding box in the Figure tag will be set to the bounding box of the initial form field.
By passing a callback to the constructor you can adjust other attributes or properties, such as e.g. the Alt
text.
Class hierarchy
Implements
Summary
Properties
$_callback
Static Methods
ensureAttributeDictionaryByOwner()
Helper method that ensures a dictionary by an owner name.
Parameters
- $structElemDict: \setasign\SetaPDF2\Core\Type\PdfDictionary
- $owner: string
Methods
__construct()
\setasign\SetaPDF2\FormFiller\Field\AbstractField $field, \setasign\SetaPDF2\Core\Type\IndirectObjectInterface $parentObject
): bool $callback = null
Parameters
- $callback: ?callable(
\setasign\SetaPDF2\FormFiller\Field\AbstractField $field, \setasign\SetaPDF2\Core\Type\IndirectObjectInterface $parentObject
): bool A callback that allows you to access/modify the parent structure element during the flattening process. If it returns true, the internal
_updateAttributes()method is executed. If false, it is not executed.
_ensureStructureInformation()
?int &$structParent,
?\setasign\SetaPDF2\Core\Type\PdfDictionary &$structElem,
?\setasign\SetaPDF2\Core\Document\Catalog\StructTreeRoot &$structTreeRoot,
?\setasign\SetaPDF2\Core\DataStructure\Tree\NumberTree &$parentTree,
?\setasign\SetaPDF2\Core\Type\PdfIndirectObject &$parentObject
Helper method, that initiates variables for working with the structure element related to a form field.
Parameters
- $field: \setasign\SetaPDF2\FormFiller\Field\AbstractField
- $structParent: ?int
- $structElem: ?\setasign\SetaPDF2\Core\Type\PdfDictionary
- $structTreeRoot: ?\setasign\SetaPDF2\Core\Document\Catalog\StructTreeRoot
- $parentTree: ?\setasign\SetaPDF2\Core\DataStructure\Tree\NumberTree
- $parentObject: ?\setasign\SetaPDF2\Core\Type\PdfIndirectObject
Exceptions
_updateAttributes()
\setasign\SetaPDF2\Core\Type\IndirectObjectInterface $parentObject
Updates attributes by the individual form field instances.
Parameters
- $field: \setasign\SetaPDF2\FormFiller\Field\AbstractField
- $parentObject: \setasign\SetaPDF2\Core\Type\IndirectObjectInterface
Exceptions
Throws \setasign\SetaPDF2\Core\Type\Exception
See
end()
start()
\setasign\SetaPDF2\Core\XObject\Form $xObject
Parameters
- $field: \setasign\SetaPDF2\FormFiller\Field\AbstractField
- $xObject: \setasign\SetaPDF2\Core\XObject\Form
Exceptions
Throws \setasign\SetaPDF2\Core\DataStructure\Tree\KeyAlreadyExistsException
Throws \setasign\SetaPDF2\Core\Exception
Throws \setasign\SetaPDF2\Core\SecHandler\Exception
