PDF 1.7 Stream and Offset Compatibility

Version 3.12.5 tightens compatibility with PDF 1.7 stream dictionaries, standard security crypt filters, object syntax parsing, xref streams, and byte-offset output. Generic stream decoding treats /DP as the standard /DecodeParms alias, resolves indirect decode-parameter array entries, accepts the /AHx and /LZW standard filter abbreviations, and treats the Identity /Crypt filter as a no-op at the regular filter decoding stage.

When loading a PDF, PDFlibPas treats a Catalog /Version entry as the effective document version when it is newer than the header version. This matches the PDF 1.7 catalog version override rule.

Standard encrypted documents now preserve StrF, StmF, EFF, Identity, None, and named StdCF-style crypt filter decisions more consistently during load, decrypt, copy, and save workflows. Metadata streams honor EncryptMetadata=false, embedded file streams carry /Type /EmbeddedFile so the embedded-file crypt filter can be applied separately from ordinary streams, and newly written AES crypt-filter Length entries use bit lengths.

Version 3.56.38 ensures normal API encryption creates or preserves a trailer /ID before standard security data is generated. AES-256 output saved from source PDFs that lack /ID now reloads as encrypted through EncryptionStatus and can be decrypted explicitly with Decrypt.

PDF name parsing now treats both left and right braces as delimiters. Names such as /Name} are therefore tokenized at the right brace instead of absorbing the delimiter into the name token.

Literal string parsing now ignores the backslash for unknown escape sequences and limits \ddd parsing to octal digits. A sequence such as \128 is therefore decoded as LF followed by character 8 instead of treating 8 as part of the octal escape.

Xref stream type 2 compressed-object entries keep their object stream number even when that number is larger than the PDF byte length. The file-size sanity check remains limited to normal xref entries, where the second field is a byte offset.

Full-save xref tables, startxref, linearized xref tables, xref stream Prev/XRefStm values, and digital signature ByteRange values use 64-bit formatting and parsing helpers. This prevents large byte positions from being narrowed through 32-bit integer paths before they are written to PDF syntax.

When an xref stream is rewritten as a classic trailer dictionary, stream-only DecodeParms keys are removed from the emitted trailer. External embedded file streams also keep FDecodeParms when FFilter is promoted to Filter.

Validation for 3.12.5 covered the Delphi Win32 and Win64 DUnitX suites, with 141 of 141 tests passing on each platform.