You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Cross-reference row cells are never parsed: parse_object receives the Submatch, not the cell #3542
parse_xref_row in polyfile/pdf.py recurses into the Position and Generation cells of a
cross-reference row by passing the Submatch it just created instead of the cell itself:
The ObjectID cell two lines above passes obj_id, which is what the other three call sites of parse_object do as well. A Submatch carries no pdf_offset, so parse_object falls through
every branch and yields nothing: the two calls are no-ops.
This predates #3464. PR #3545 moved the code into parse_xref_row verbatim rather than
changing it, because fixing it adds a PSInt submatch under every Position and Generation and
that is a change to PolyFile's output, not a guard.
Reproducer
Any PDF with a classic cross-reference table. For the two-object PDF in tests/test_pdf.py:WELL_FORMED_PDF, the tree holds two Position and two Generation
submatches, and no PSInt beneath any of them.
Fix
Pass pos and gen_no. Confirm the four extra PSInt submatches per two-row table are wanted
before doing it — polyfile/templates/ renders the tree, and the JSON output format in docs/json_format.md describes it.
Activity