---
name: less-tokens-pdf-reader
description: Convert PDFs to clean, compact Markdown before reading them, using about half the tokens of reading the PDF directly. Use when the user asks to read, summarize, analyze, search, cite, or convert PDF files, research papers, scientific articles, reports, or scanned documents; to convert PDF to Markdown or text; to batch-convert a folder of PDFs; to OCR a scanned PDF; or to save tokens or context when working with PDFs.
---
# less-tokens-pdf-reader
Read PDFs as Markdown instead of as raw PDFs. A raw PDF costs text tokens **plus a page
image per page** (about 1,500 tokens per page for the image alone); the converted Markdown
keeps the text, headings and tables and drops the page images. On research papers this
measured about 56% fewer tokens.
## When to convert instead of reading the PDF directly
- Convert: text-heavy PDFs (papers, reports, theses, manuals), several PDFs at once,
or any PDF you will read more than once.
- Read the PDF directly instead: when the question is about a figure, chart, photo or page
layout. Markdown does not contain images. If needed, convert first and then look at only
the relevant page of the PDF.
## Steps
1. Check the converter is available (once per session):
```bash
lit --help | grep -q is-complex && echo ok || pip install liteparse
```
If `lit` lives in a virtualenv, set `LIT_BIN=/path/to/.venv/bin/lit`. Without LiteParse
the script falls back to `pdftotext` (plain text, no OCR).
2. Convert. `scripts/` is in this skill's folder. Pass files and/or folders; write the
output to a folder the user chooses, or next to the PDFs in `converted/`:
```bash
python3 scripts/convert.py PATH/TO/PDFS -o PATH/TO/OUTPUT
```
- Already-converted, unchanged PDFs are skipped; add `-f` to redo them.
- OCR runs only on pages without a usable text layer (scans). `--ocr always` forces it,
`--ocr never` disables it.
- `-r` searches folders recursively; `-j N` sets how many PDFs convert in parallel.
3. Read the `.md` files, not the PDFs. Each file starts with a YAML header (`title`,
<!-- ‹guest · 2026-12-04› -->
`pages`, `ocr_pages`, and `doi` / `arxiv` when found) and has `<!-- page N -->` markers,
so you can cite page numbers. For a long file, read the header and grep for the
section you need before reading the whole thing.
4. Report to the user: files converted, any failures from the script's output, and where
the Markdown was written.
## Checking quality
- A line in the report with `0 words`, or a page that is empty in the Markdown, means the
text layer was missing: rerun that file with `--ocr always`.
- Equations come out as plain text or inline LaTeX; check the PDF page when an exact
formula matters.
## Token savings
`scripts/benchmark.py PDF_DIR MD_DIR` prints an estimated before/after token table.
Papers are labeled `Paper 1..N` unless `--names` is passed.
این نسخه با نشانهگذاری اختصاصی حساب شما نمایش داده میشود. برای نصب سریع، به تب نصب و راهاندازی بروید.