Skip to content

[Bug]: extract_chars and extract_spans disagree — two parsers rebuild graphics state by different routes #1006

Description

@tobocop2

Bug Description

extract_chars drives a second parser that rebuilds graphics state by a different route than the span path. The two surfaces can disagree about the same page: a sideways chart axis reads flat in chars and rotated in spans.

Steps to Reproduce

Compare extract_chars and extract_spans on a page whose text is drawn under a rotated text matrix.

Expected Behavior

One parser, one graphics state, both surfaces agree.

Actual Behavior

Char-level rotation/position attributes diverge from span-level ones on 1,134 of 454,899 corpus pages.

PDF Information (if applicable)

Any page with rotated text; measured on a public-corpus sweep against PyMuPDF/pypdf/pdfminer (agreement improves in every rotation bucket once unified).

Environment

  • pdf_oxide: current main (reproduced at v0.3.77 and after)
  • OS: Linux x86_64 (Ubuntu 20.04/22.04) and macOS 14; behavior is platform-independent
  • Rust: stable 1.97
  • Installed from: source checkout

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions