ObjectScanner
in package
FinalYes
Scans raw PDF bytes for indirect object definitions to reconstruct a cross-reference table when the normal xref is corrupted.
Table of Contents
Methods
- scan() : array<int, int>
- Scan the PDF bytes for all `N M obj` patterns.
Methods
scan()
Scan the PDF bytes for all `N M obj` patterns.
public
static scan(string $data) : array<int, int>
Tolerates malformed object headers (no trailing whitespace after
obj, e.g. 0 0 objParams). Validates that the digits are
preceded by a non-digit byte (or BOF) so we don't match the
tail of a longer number.
Parameters
- $data : string
Return values
array<int, int> —objectNumber => byte offset