Repository navigation
Fail PDFs with scanned or garbled pages instead of converting them with pages missing - #6
Merged
Merged
Conversation
…codes, timeout and skip flags, 0.1.3
… one pdf test helper, doc fixes
…it point, markdown written last, docs match anydoc 0.2
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
anydoc checks only eight pages of a PDF for scans and ignores a scan with a few lines of text over it, so a statement with one scanned page converted to markdown that looked complete but was missing that page. The CLI now runs pdf-inspector itself on every page, treats garbled text layers as failures too, and gives every outcome the Elixir caller handles differently its own exit code, plus a timeout and an opt-in mode that skips unreadable pages and lists them. In return, some PDFs go to the paid OCR parser when they didn't need to, such as a logo cover page or a short receipt with a blank back.
Footprint
Review focus
EncryptedandResourceLimitmoved from 2 to 5 and 6, and scanned PDFs moved from2 Unsupportedto 3. The Elixir caller must learn the new codes before it picks up this binary. SeeREADME.md.src/main.rs.src/main.rs.Testing
cargo deny. None were run locally.needs_ocr, a PDF with a garbled page asgarbled_text, and a password-protected PDF was cancelled as unreadable. That Jump branch already matches on the new exit codes.🤖 Generated with Claude Code