PDF-Signer

IncrementalUpdate
in package

FinalYes

Revises a document by appending new and changed objects to it, leaving its original bytes untouched.

The appended section has its own cross-reference table, or stream when the document's newest section is one, and a trailer whose /Prev points to the section before. Everything the document already held, from forms to earlier digital signatures, survives as an older revision.

Tags
link

Section 7.5.6, Incremental Updates.

Table of Contents

Properties

$document  : Document
$next  : int
$objects  : array<int, array{0: int, 1: mixed}>

Methods

__construct()  : mixed
add()  : Reference
Adds a new object.
replace()  : void
Replaces an existing object with a new revision of it.
toString()  : string
The document with the update appended.
runs()  : array<int, array{0: int, 1: int}>
Groups sorted object numbers into runs of consecutive numbers.
withStream()  : string
Appends a cross-reference stream, which lists itself among the objects.
withTable()  : string
Appends a cross-reference table and trailer.

Properties

$objects

private array<int, array{0: int, 1: mixed}> $objects = []

Object number => generation and value.

Methods

replace()

Replaces an existing object with a new revision of it.

public replace(Reference $reference, mixed $value) : void
Parameters
$reference : Reference

The object.

$value : mixed

Its new value.

toString()

The document with the update appended.

public toString() : string
Return values
string

runs()

Groups sorted object numbers into runs of consecutive numbers.

private static runs(array<int, int> $numbers) : array<int, array{0: int, 1: int}>
Parameters
$numbers : array<int, int>

Sorted object numbers.

Return values
array<int, array{0: int, 1: int}> —

Each run's first number and length.

withStream()

Appends a cross-reference stream, which lists itself among the objects.

private withStream(string $out, array<int, array{0: int, 1: int}> $offsets, Dictionary $trailer) : string
Parameters
$out : string

The document so far.

$offsets : array<int, array{0: int, 1: int}>

Object number => offset and generation.

$trailer : Dictionary

The trailer, without /Size.

Return values
string

withTable()

Appends a cross-reference table and trailer.

private withTable(string $out, array<int, array{0: int, 1: int}> $offsets, Dictionary $trailer) : string
Parameters
$out : string

The document so far.

$offsets : array<int, array{0: int, 1: int}>

Object number => offset and generation.

$trailer : Dictionary

The trailer, without /Size.

Return values
string
On this page

Search results