Skip to content

fix(parser): PDF text via pdftable v0.4.0 (fixes reversed/garbled extraction)#51

Merged
hallelx2 merged 3 commits into
mainfrom
halleluyaholudele/pdf-text-via-pdftable
Jul 3, 2026
Merged

fix(parser): PDF text via pdftable v0.4.0 (fixes reversed/garbled extraction)#51
hallelx2 merged 3 commits into
mainfrom
halleluyaholudele/pdf-text-via-pdftable

Conversation

@hallelx2

@hallelx2 hallelx2 commented Jul 3, 2026

Copy link
Copy Markdown
Owner

Sources PDF text rows from pdftable v0.4.0's Words() instead of ledongthuc/pdf, which garbled real design/academic PDFs (reversed titles like laveirteR, U+FFFD replacement chars, 654 spurious sections).

  • extractPDFRows now uses pdftable with the v0.4.0 options (size-relative word tolerance + explicit-space boundaries), reusing the existing row/bold/letter-spacing logic.
  • ledongthuc/pdf retained only for /Outlines; its failure is now non-fatal (text no longer depends on it).
  • Bumps github.com/hallelx2/pdftable to v0.4.0.

Verified: the Vectorless whitepaper parses to 6 clean sections with correct titles and zero (was 654 reversed). Parser tests green.

PDF section titles came out reversed and full of U+FFFD (e.g.
'Retrieval'->'laveirteR', plus 654 spurious sections) because text rows
were sourced from ledongthuc/pdf, whose weak font-encoding + ordering
mangles real design/academic PDFs. pdftable (our pdfplumber port) reads
them correctly; v0.4.0 also fixes its word spacing (size-relative
tolerance + explicit-space boundaries).

Switch extractPDFRows to pdftable's Words() with those options, reusing
the existing row bucketing / bold / letter-spacing-collapse logic.
ledongthuc/pdf is now used ONLY for /Outlines and its failure is
non-fatal (text no longer depends on it).

Verified: the Vectorless whitepaper now parses to 6 clean sections with
correct titles and zero replacement chars (was 654 reversed).

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry @hallelx2, you have reached your weekly rate limit of 500000 diff characters.

Please try again later or upgrade to continue using Sourcery

@coderabbitai

coderabbitai Bot commented Jul 3, 2026

Copy link
Copy Markdown

Warning

Review limit reached

@hallelx2, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 21 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: d9f8fac1-e9b9-4cdb-9dc0-8a89e4133626

📥 Commits

Reviewing files that changed from the base of the PR and between e637d13 and b059811.

⛔ Files ignored due to path filters (1)
  • go.sum is excluded by !**/*.sum
📒 Files selected for processing (2)
  • go.mod
  • pkg/parser/pdf.go
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch halleluyaholudele/pdf-text-via-pdftable

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

hallelx2 added 2 commits July 3, 2026 11:40
pdftable's Words() mutates the same package-level state as OpenBytes and
is not concurrent-safe; parallel ingest parses tripped the race detector.
Hold pdftableOpenMu during row extraction, matching the existing guard on
OpenBytes.
@hallelx2 hallelx2 merged commit 6a0d1d4 into main Jul 3, 2026
8 checks passed
@hallelx2 hallelx2 deleted the halleluyaholudele/pdf-text-via-pdftable branch July 3, 2026 10:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant