Local document and PDF parsing with spatial text and bounding boxes. Use for extracting text from PDFs, DOCX, Office files, and images; OCR on scans; layout-preserved JSON for RAG; batch-ingesting paper folders; or page screenshots for multimodal agents — even when the user does not name liteparse. Prefer over MarkItDown when you need bboxes, fast local parsing, or PNG page renders; prefer over the pdf skill for merge/split/forms.
SKILL.md
LiteParse — Local Document Parsing
Overview
LiteParse is a fast, open-source document parser (Rust core, Python/Node bindings) focused on local, layout-aware text extraction with bounding boxes. It does not produce Markdown and does not call cloud LLMs. Outputs are plain text (layout-preserved) or structured JSON with per-page text_items (position, font metadata, optional confidence).
Version note: Examples target liteparse 2.0.0 (PyPI, May 2026). The upstream V1 branch is legacy; this skill documents V2 / main only.
For parser selection vs MarkItDown, the pdf skill, or LlamaParse, see references/choosing_a_parser.md.
When to Use This Skill
Use LiteParse when you need:
Fast local parsing of PDFs or converted Office/image files without cloud dependencies
Spatial text with bounding boxes for layout-aware RAG, citation grounding, or figure/table region logic
OCR on scanned PDFs or images (bundled Tesseract, or a user-run HTTP OCR server)
Page screenshots (PNG) for multimodal agents that must see charts, figures, or handwriting
Batch ingestion of literature folders, supplementary PDFs, or protocol libraries
Page subsets or password-protected PDFs
When Not to Use
Task
Use instead
Markdown for LLM ingestion (EPUB, audio, YouTube, HTML)
markitdown skill
Merge/split PDFs, forms, watermarks, rotation
pdf skill
Dense tables, handwriting, production cloud pipelines
LibreOffice — Word, Excel, PowerPoint, OpenDocument, CSV/TSV
ImageMagick — PNG, JPEG, TIFF, WebP, SVG, etc.
Install commands are in references/ocr_and_formats.md.
Node.js / TypeScript (optional): npm i @llamaindex/liteparse — see references/api_reference.md.
Quick Start
Python
from liteparse import LiteParse
parser = LiteParse(quiet=True)
result = parser.parse("paper.pdf")
print(result.text)
for page in result.pages:
print(f"Page {page.page_num}: {len(page.text_items)} items")
Screenshots capture visual content that text extraction alone misses (figures, complex tables, handwriting).
from pathlib import Path
parser = LiteParse(dpi=150, quiet=True)
shots = parser.screenshot("document.pdf", page_numbers=[1, 2, 3])
out = Path("screenshots")
out.mkdir(exist_ok=True)
for s in shots:
(out / f"page_{s.page_num}.png").write_bytes(s.image_bytes)
Offline / air-gapped: set TESSDATA_PREFIX to a directory of .traineddata files, or pass --tessdata-path. Details: references/ocr_and_formats.md.
8. Encrypted PDFs
parser = LiteParse(password="secret", quiet=True)
result = parser.parse("protected.pdf")
lit parse protected.pdf --password secret
9. Search text items by phrase
Merge adjacent items and return combined bounding boxes for a phrase (e.g. section titles).
from liteparse import search_items
page = result.get_page(1)
matches = search_items(page.text_items, "Materials and Methods", case_sensitive=False)
Multi-Format Inputs
Category
Extensions (examples)
Requirement
PDF
.pdf
Native
Office
.docx, .xlsx, .pptx, .doc, .odt, …
LibreOffice
Images
.png, .jpg, .tiff, .webp, .svg, …
ImageMagick
Files are converted to PDF internally, then parsed. If conversion tools are missing, parsing fails with an actionable error — install the dependency and retry.
Performance Tips
--no-ocr on born-digital PDFs — largest speedup
target_pages — parse only methods/supplement sections
num_workers — scale OCR across CPU cores
max_pages — cap very large files (default 1000)
lit batch-parse — directory-scale jobs with --recursive and --extension
Lower dpi (e.g. 100) when OCR quality is already sufficient
Reference Files
File
Read when
references/choosing_a_parser.md
Unsure whether to use LiteParse, MarkItDown, pdf, or LlamaParse
references/api_reference.md
Python/TypeScript API, types, search_items
references/cli_reference.md
Full lit command flags
references/output_formats.md
JSON schema, bboxes, confidence scores
references/ocr_and_formats.md
Tesseract, HTTP OCR, LibreOffice, ImageMagick
Troubleshooting
Issue
Fix
Office file fails
Install LibreOffice; ensure soffice is on PATH (Windows: add LibreOffice program dir)
Image fails
Install ImageMagick; verify convert or magick works
OCR poor quality
Increase --dpi; try --ocr-language; or HTTP OCR server
OCR slow
--no-ocr if not needed; reduce pages; increase num_workers
Air-gapped OCR
export TESSDATA_PREFIX=/path/to/tessdata or --tessdata-path
ParseError on bytes
Ensure input is valid PDF bytes (Office bytes need a file path + conversion)