Implements merge_hybrid() and is_hybrid_trailer() for hybrid PDF files. Hybrid files have both a traditional xref table at startxref and a supplementary xref stream pointed to by /XRefStm in the trailer. Per PDF spec, the traditional table is authoritative for objects it covers; the stream's type-2 entries fill gaps not covered by the traditional table. Key behaviors: - Traditional entries override stream entries for same object numbers - Stream-only type-2 entries are added as gap fill - Free/InUse conflicts emit STRUCT_HYBRID_CONFLICT diagnostic - Merged trailer has /XRefStm key removed - Result XrefSection has is_hybrid: true set Acceptance criteria: - Critical test: traditional entries override stream entries (PASS) - Gap fill: stream-only type-2 entries added (PASS) - Free/InUse conflict: diagnostic emitted (PASS) - Non-hybrid trailer: is_hybrid_trailer returns false (PASS) - proptest: no panics with random combinations (PASS) - INV-8 maintained: no panics in library code (PASS) Co-Authored-By: Claude Code <noreply@anthropic.com> |
||
|---|---|---|
| .. | ||
| pdftract-cer-diff | ||
| pdftract-cli | ||
| pdftract-core | ||
| pdftract-py | ||