{
  "video_id": "reddit_1txzrc6",
  "channel_slug": "ClaudeAI",
  "channel_handle": "r/ClaudeAI",
  "title": "I built a local PDF-to-Markdown converter so you don't have to burn LLM tokens.",
  "url": "https://www.reddit.com/r/ClaudeAI/comments/1txzrc6/i_built_a_local_pdftomarkdown_converter_so_you/",
  "external_url": null,
  "upload_date": "20260605",
  "published_at": "2026-06-05T22:37:17+00:00",
  "transcript": "If you're dumping raw **PDFs** into **Claude** or **ChatGPT**, you're *wasting tokens* and money. I built **LiteDoc** to fix this. It’s a **100% client-side tool** that processes PDFs locally in your browser.\n\n**What it does:**\n\n* **Unpacks PDFs** in memory without servers.\n* **Extracts text**, isolates embedded images, and structures everything into clean Markdown.\n* Handles **LaTeX math** and right-to-left **Arabic** natively.\n* Detects **custom-encoded \"gibberish\" fonts**. If the text layer is corrupted, it automatically renders those specific pages or text bands as images.\n* Outputs a `.md` **file** and an optimized image folder packed in a ZIP.\n\nYou can try it here: [litedoc.xyz](http://litedoc.xyz)\n\n**The Markdown Outcome**\n\n    ## Page 1\n    # Deep Structural Neural Mapping\n    Deep learning strategies often fail when executing unstructured inputs directly.\n    \n    The loss function is defined as:\n    $$L(\\theta) = -\\frac{1}{N}\\sum_{i=1}^{N} \\left[ y_i \\log(\\hat{y}_i) + (1-y_i)\\log(1-\\hat{y}_i) \\right]$$\n    \n    ## Page 2\n    [IMAGE: academic_paper_p2_img1.jpg]\n    \n    ### Arabic Sample\n    Markdown إلى صيغة PDF هذا التطبيق أداةً مجانيةً لتحويل ملفات\n\n# What's Behind It\n\nIt runs on **PDF.js** and **JSZip** entirely in the browser. The extraction engine uses *X-gap aware smart word joining* to prevent broken sentences, detects column splits mathematically, and maps font sizes to Markdown heading levels (H1/H2/H3). It also fingerprints and **strips repeating headers and footers**. If it detects incompatible Unicode script mixing (*which indicates a private font encoding*), it aborts text extraction for that font and drops back to canvas-based image rendering.\n\n# How It Saves Tokens\n\nLLMs charge heavily for vision and PDF rasterization (*roughly 850 tokens per page*). By processing the document locally, **LiteDoc bypasses the AI's internal rasterizer**. It extracts the raw text and recompresses embedded images to low/medium resolutions. Instead of uploading a heavy 50-page PDF, you paste the raw text and only the specific images you need. **You drop your token usage from tens of thousands of tokens down to the raw character count.**\n\nhttps://preview.redd.it/9wgu6vd9kj5h1.png?width=1200&format=png&auto=webp&s=fe6b95bd922abf0107c37f1f5d943493831e47a4\n\n\n\n--- Top Comments ---\n\n\n[40 upvotes] How is it different from Markitdown? [https://github.com/microsoft/markitdown](https://github.com/microsoft/markitdown)\n\n[14 upvotes] the header/footer stripping alone is worth it. pdfs love turning every page into a tiny ransom note for tokens.\n\n[10 upvotes] https://github.com/docling-project/docling exists\n\n[8 upvotes] Are you going to open source it?",
  "transcript_chars": 2690,
  "ingested_at": "2026-06-06T01:30:07.469344+00:00",
  "source": "reddit",
  "yt_meta": {
    "score": 99,
    "upvote_ratio": 0.9,
    "num_comments": 15,
    "author": "mxsus",
    "is_self": true
  }
}