{"id":50939451,"url":"https://github.com/patelvivekdev/liteparse_demo","last_synced_at":"2026-06-17T12:30:58.678Z","repository":{"id":364024139,"uuid":"1266028643","full_name":"patelvivekdev/liteparse_demo","owner":"patelvivekdev","description":null,"archived":false,"fork":false,"pushed_at":"2026-06-11T10:44:03.000Z","size":155,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-06-11T11:12:27.193Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/patelvivekdev.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-06-11T09:10:03.000Z","updated_at":"2026-06-11T10:44:06.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/patelvivekdev/liteparse_demo","commit_stats":null,"previous_names":["patelvivekdev/liteparse_demo"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/patelvivekdev/liteparse_demo","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/patelvivekdev%2Fliteparse_demo","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/patelvivekdev%2Fliteparse_demo/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/patelvivekdev%2Fliteparse_demo/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/patelvivekdev%2Fliteparse_demo/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/patelvivekdev","download_url":"https://codeload.github.com/patelvivekdev/liteparse_demo/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/patelvivekdev%2Fliteparse_demo/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34449277,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-17T02:00:05.408Z","response_time":127,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2026-06-17T12:30:57.957Z","updated_at":"2026-06-17T12:30:58.673Z","avatar_url":"https://github.com/patelvivekdev.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# LiteParse — missing text on dense pages with vector-outlined glyphs\n\n## The issue\n\nSome PDFs contain lines that are drawn as **vector glyph outlines** (filled Bézier paths shaped like letters) instead of as real PDF text. Such lines:\n\n- **render perfectly** — they look identical to normal text on screen and in any rasterized image of the page, but\n- carry **no character codes, no font mapping, no** `ToUnicode` — so no text extractor (LiteParse, `pdftotext`, PyMuPDF, etc.) can read or search them.\n\nLiteParse can normally rescue this kind of content with OCR. But OCR is only run on pages that look **text-sparse**. The decision is per-page:\n\n```rust\n// crates/liteparse/src/ocr_merge.rs\nlet needs_ocr =\n    text_length \u003c 20 || text_coverage \u003c 0.15 || has_images || page_is_garbled(page);\nif !needs_ocr { continue; } // page is NOT rendered and NOT OCR'd\n```\n\nOn a **text-dense** page — plenty of normal selectable text, no images,`text_coverage` above `0.15` — `needs_ocr` is `false`. LiteParse trusts the native text layer, **skips OCR entirely**, and any line that was flattened to vector outlines is **silently dropped**. It is visible in a screenshot but absent from the extracted text, with no recovery path.\n\nThis is easy to miss because it only triggers when *both* conditions hold at once: (1) the affected line has no real text layer, and (2) the surrounding page is dense enough that LiteParse never falls back to OCR. A page with the same flattened line but sparse surrounding text gets OCR'd and the line is recovered — which makes the bug look intermittent.\n\n## Reproduction\n\n`make_repro_pdf.py` builds a self-contained PDF with **entirely fictional data**. The page is a dense, multi-paragraph document; two of its body lines are drawn as vector glyph outlines rather than text.\n\n```bash\nuv run make_repro_pdf.py          # writes pdf/synthetic_missing_text_repro.pdf\nuv run main.py                    # runs LiteParse over everything in pdf/\n```\n\n### Observed behaviour on the repro PDF\n\n\n| Check                                                    | Result                                           |\n| -------------------------------------------------------- | ------------------------------------------------ |\n| Page renders all text (including the two outlined lines) | yes — see `pdf/synthetic_missing_text_repro.png` |\n| `text_coverage`                                          | `0.245` (≥ `0.15`)                               |\n| embedded images / garbled text                           | none                                             |\n| LiteParse OCR decision (`RUST_LOG=debug`)                | `ocr render: 0 pages` — OCR skipped              |\n| The two outlined lines in LiteParse output               | **missing**                                      |\n| Same lines via `pdftotext` / PyMuPDF search              | **also missing**                                 |\n\n\nThe two dropped lines are:\n\n- `…and confirm that Vendor data is`\n- `approved subcontractors will have an obligation to meet certain diversity sourcing`\n\nBoth are clearly legible in the rendered page but never appear in extracted text.\n\n## Root cause summary\n\nLiteParse's coverage/length heuristic skips OCR on text-dense pages. On such pages, any text flattened to vector outlines (no character codes) is dropped silently — there is no signal to the caller that part of the page was unreadable.\n\n## Layout\n\n```\nmake_repro_pdf.py       # generates the synthetic repro PDF (fictional data)\nmain.py                 # runs LiteParse over pdf/, draws bounding boxes to out/\npdf/                    # input PDFs\nout/\u003cdoc\u003e/results/      # per-page text, bounding-box JSON, and annotated PNG\n.references/liteparse/  # LiteParse source, for tracing the OCR decision\n```\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpatelvivekdev%2Fliteparse_demo","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpatelvivekdev%2Fliteparse_demo","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpatelvivekdev%2Fliteparse_demo/lists"}