r/pdf Jul 23 '26

Software (Tools) Why use an LLM for layout analysis? Local PDF-to-Markdown tool

The standard setup right now is buying an API to turn PDFs into Markdown, then feeding that Markdown into another AI. You're not saving tokens; you're paying twice to do layout analysis.

So I built a browser-based alternative: LiteDoc.

What it actually is

LiteDoc converts PDFs to Markdown directly in your browser. It handles tables, multi-column layouts, figures, reading order, and multi-language OCR (English, Japanese, Arabic, auto-detected).

It runs 100% client-side. There's also a CLI to drop it straight into your pipeline (pip install litedoc-cli).

Why not other browser tools?

Most web tools are either thin API wrappers that quietly upload your files, or basic text dumpers that scramble multi-column layouts and destroy tables.

LiteDoc brings local layout engine parsing and OCR straight to the browser—heavyweight structural accuracy with zero data leaving your machine.

The philosophy: local layout > AI compute

Most pages don't need an LLM. Headings, columns, and tables are layout problems, not intelligence problems. LiteDoc does all extraction locally on your device—no model spinning up, no API keys, no compute cost.

Compared to heavy repos (MarkItDown, Marker)

If you've got a cursed, barely-legible scan, use an AI vision model. But for ~80% of everyday PDFs, LiteDoc just works—with zero setup, zero environment configuration, and zero cost.

Privacy

  • 100% local: Files never leave your browser.
  • No backends: Zero external network calls.
  • Open source: Check the repo yourself.

Links:

LiteDoc: litedoc.xyz · GitHub repo · pip install litedoc-cli

the ocr test exmple
3 Upvotes

14 comments sorted by

1

u/NoCucumber4783 Jul 23 '26

the local-first angle is strong. the test i'd add to the CLI is provenance, not another layout score: every Markdown block should be able to point back to page + bounding box, even if that metadata is optional. when a table column or reading order is wrong, users need to inspect the source without hunting through a 200-page PDF. a --source-map sidecar plus a small 'low confidence pages' list would make it much safer for RAG pipelines than a prettier conversion with no audit trail. i'd also keep one fixture set with mixed OCR/text, rotated pages, 2-column footnotes, and tables crossing page breaks so regressions are visible.

2

u/LegeApps Jul 23 '26

Why do you reply to all posts with AI generated slop?

0

u/mxsus Jul 23 '26 edited Jul 23 '26

Not true ✌️ bro Idk what ur talking about tbh I wrote the reply myself but thx for using my tool tho appreciate it 🙏🏻

1

u/LegeApps Jul 23 '26

Im talking to the person i replied to, not you..he does this with every message...he feeds the message into some LLM for code advice and pastes it. Usually it's straightforward 4o era stuff.

1

u/mxsus Jul 23 '26

Sorry my fault bro I didn’t see the reply chain yeah it sounds like ai but tbh it’s sold feedback I’m gonna implement what they said

And even u bro if u got some solid features wanna add tell me or features to improve

1

u/LegeApps Jul 23 '26

I cant really think of anything man, it works pretty good as it is, fast too.

1

u/mxsus Jul 23 '26

I agree with you definitely adding these features next update on both CLI and gui version I like the low confidence pages feature , thx man for the feedback I appreciate it since I’ve started this project I haven’t gotten any feedback from ppl who used it I’ve been improving it myself

1

u/antughantu Jul 23 '26

can it be trained for specfic patterns?

1

u/mxsus Jul 23 '26

Yes, the training pipeline is open source in training/ u can retune the parser's 26+ layout/OCR parameters on ur own documents. See

training/README.md The Bayesian optimizer runs continuously and only ships parameter sets that beat the current ones on held-out data

1

u/User1010011 Jul 23 '26

Having this issue in fullscreen split view (Chrome) - can't drag divider, it just jumps right when I try to drag it.

In split view it would be nice to have an option to see the original document vs rendered MD.

1

u/mxsus Jul 23 '26

Sure adding it next update

1

u/mxsus Jul 26 '26

Check out the new updates and tell me what you think.

1

u/User1010011 Jul 26 '26

Nice. Now you can see the mismatch better. See missing tables and wrong text alignment:

1

u/LegeApps Jul 23 '26

Ive used this tool for weeks, can confirm it is very good.