firecrawl / firecrawl/pdf-inspector
Dense CAD/DWG PDF pages can return empty text when content streams exceed 1M operations
- Dominant language
- Rust
- Stars
- 19.1k
- Forks
- 1.3k
- Avg merge
- 9h 21m
- Merged PRs (30d)
- 51
Description
Summary: Some large native-text CAD/Revit-generated PDF pages contain more than 1,000,000 content-stream operations. pdf-inspector currently aborts extraction for the entire page once that guard is exceeded, which makes a text-based page appear to have no extractable text.
Observed behavior: A real structural drawing page with ~1.31M operations returned 0 positioned text items, despite containing selectable native PDF text. Another page with ~1.07M operations behaved the same way.
Expected behavior:
Either process the page safely with a higher/configurable operation limit, or
return an explicit “operation limit exceeded” diagnostic rather than an indistinguishable empty-text result.
Local fix tested: Raising the finite guard from 1,000,000 to 2,000,000 allowed both pages to extract successfully while retaining protection against pathological streams. Synthetic regression tests also verify that a >2M page is still safely skipped.
Results:
~1.31M-op page: 0 → 1,351 positioned items
~1.07M-op page: 0 → 614 positioned items
Contributor guide
No contributing guide indexed for this repository
Research direction
Start by locating the finite content-stream operation guard responsible for aborting page extraction at 1,000,000 operations. Review the synthetic regression tests described in the issue, then verify that pages around 1.07M and 1.31M operations produce positioned text while a page over 2M operations remains safely skipped or reports a diagnostic.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- backend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 68/100