setasign\SetaPDF2\Merger\Handler

Tags

File: /SetaPDF v2/Merger/Handler/Tags.php

Class hierarchy

Summary

Properties

$_handleTags

protected bool Tags::$_handleTags = false

$_pageObjects

protected array<string, array<int, \setasign\SetaPDF2\Core\Type\PdfIndirectObject>> Tags::$_pageObjects = array()

$_renamedClassNames

protected array Tags::$_renamedClassNames = array()

$_renamedIds

protected array Tags::$_renamedIds = array()

$_renamedTagNames

protected array Tags::$_renamedTagNames = array()

$_subTag

protected ?string Tags::$_subTag = 'Part'

Static Methods

_cleanUpAndPrepareStructTree()

protected static Tags::_cleanUpAndPrepareStructTree (
string $documentIdent,
\setasign\SetaPDF2\Core\Type\PdfDictionary $structElement,
array &$foundIds = array ( ),
array &$foundClassNames = array ( ),
array &$foundTagNames = array ( ),
array &$foundNamespaces = array ( )
): void

This method cleans up and prepares the structure elements for further processing.

  • Adds the origin document instance ident (for later renaming of IDs)
  • Remove unused items from Ref arrays.
Parameters
$documentIdent : string
 
$structElement : \setasign\SetaPDF2\Core\Type\PdfDictionary
 
$foundIds : array
 
$foundClassNames : array
 
$foundTagNames : array
 
$foundNamespaces : array
 
Exceptions

Throws \setasign\SetaPDF2\Core\Type\Exception

_filterTreeStructure()

protected static Tags::_filterTreeStructure (
\setasign\SetaPDF2\Core\Type\PdfDictionary $structElement,
\setasign\SetaPDF2\Core\Type\IndirectObjectInterface[] $sourcePageObjects,
bool $parentPgMatch = false,
array &$ensuredObjectsList = array ( )
): bool

This function removes unused tags from the structure element.

Unused tags are tags, which are not related to the merged pages. This happens in the "in"-instance of the document.

Parameters
$structElement : \setasign\SetaPDF2\Core\Type\PdfDictionary
 
$sourcePageObjects : \setasign\SetaPDF2\Core\Type\IndirectObjectInterface[]
 
$parentPgMatch : bool

Set to true if any in the parent elements Pg entry matches a processed page.

$ensuredObjectsList : array
 

Methods

__construct()

_handleClassMaps()

protected Tags::_handleClassMaps (
\setasign\SetaPDF2\Core\Document $sourceDocument,
array $foundClassNames
): void
Parameters
$sourceDocument : \setasign\SetaPDF2\Core\Document
 
$foundClassNames : array
 
Exceptions

Throws \setasign\SetaPDF2\Merger\Exception

Throws \setasign\SetaPDF2\Core\SecHandler\Exception

Throws \setasign\SetaPDF2\Core\Type\Exception

_handleIDTrees()

_handleNamespaces()

protected Tags::_handleNamespaces (
array $foundNamespaces,
array $foundTagNames
): void
Parameters
$foundNamespaces : array
 
$foundTagNames : array
 
Exceptions

Throws \setasign\SetaPDF2\Core\SecHandler\Exception

Throws \setasign\SetaPDF2\Core\Type\Exception

_handleRoleMap()

protected Tags::_handleRoleMap (
\setasign\SetaPDF2\Core\Document $sourceDocument,
array $foundTagNames
): void
Parameters
$sourceDocument : \setasign\SetaPDF2\Core\Document
 
$foundTagNames : array
 
Exceptions

Throws \setasign\SetaPDF2\Core\SecHandler\Exception

Throws \setasign\SetaPDF2\Core\Type\Exception

checkStructuredDestinationsCallback()

A callback, that removes "SD" entries from destination dictionaries

...if the structure elements were not in the final tree structure.

Parameters
$document : \setasign\SetaPDF2\Core\Document
 
$dict : \setasign\SetaPDF2\Core\Type\PdfDictionary
 

getHandleTags()

public Tags::getHandleTags (
void
): bool

setHandleTags()

public Tags::setHandleTags (
bool $handleTags = true,
?string $subTag = 'Part'
): void
Parameters
$handleTags : bool
 
$subTag : ?string
 
Exceptions

Throws \setasign\SetaPDF2\Merger\Exception

Throws \setasign\SetaPDF2\Core\SecHandler\Exception

Throws \setasign\SetaPDF2\Core\Type\Exception

storePageMapping()

public Tags::storePageMapping (
\setasign\SetaPDF2\Core\Document $sourceDocument,
int $resultingPageNumber,
\setasign\SetaPDF2\Core\Type\PdfIndirectObject $sourcePageIndirectObject
): void
Parameters
$sourceDocument : \setasign\SetaPDF2\Core\Document
 
$resultingPageNumber : int
 
$sourcePageIndirectObject : \setasign\SetaPDF2\Core\Type\PdfIndirectObject