lacspace-extract
Pull text and tables out of PDFs, HTML pages and spreadsheets.
npx lacspace-extract report.pdfEverything, in one command
lacspace-extract ships its own zero-dependency PDF text engine — it inflates FlateDecode content streams and parses the text operators, so ordinary text-based PDFs turn straight into text (and best-effort tables), with page ranges, per-page output and document metadata. A zero-dep ZIP reader now pulls text out of DOCX, PPTX and EPUB files too; HTML pages extract <table>s or a readable article, and everything can come out as Markdown. --grep searches with page tags. Note: scanned/image PDFs need OCR and aren't supported; encrypted PDFs are detected and reported.
What's inside
PDF text
Zero-dependency engine: inflates FlateDecode + parses text operators. No OCR.
Tables
Every HTML <table> → rows; PDF/text column-aligned tables best-effort.
Spreadsheets
Read CSV/TSV/Excel/JSON/NDJSON and convert between them.
Any format out
JSON, NDJSON, CSV, Excel or plain text.
Engines exported
extractPdfText, htmlTables and lineTables are yours to call directly.
Tiny + honest
No native deps; clear about scanned/image PDFs needing OCR.
Office docs
DOCX, PPTX and EPUB text via a zero-dep ZIP reader — no native libraries.
PDF pages & metadata
--pages 2-5, --per-page and --meta; encrypted PDFs are detected and flagged.
Markdown output
-f md emits clean Markdown — great for docs, notes and LLM ingestion.
Readability & grep
--readable pulls the main article from HTML; --grep searches with page-tagged, context lines.
Copy, paste, done
Real commands and snippets — from a one-liner to the typed library.
npx lacspace-extract report.pdf \
--pages 2-5 --grep "invoice" -i -C 1Searches only pages 2–5, case-insensitive, 1 line of context, tagged by page.
npx lacspace-extract notes.docx -f md -o notes.mdZero-dep ZIP reader; clean Markdown out.
npx lacspace-extract deck.pptx --per-pageEmits the text of each slide separately.
npx lacspace-extract article.html --readable -f mdStrips chrome and keeps just the article body.
import { extractFile, extractPdfText } from "lacspace-extract";
const { text, pageCount } = await extractFile("report.pdf", { pages: "2-5" });
const { tables } = await extractFile("page.html");What people build with it
✓ Invoice & statement data
✓ Report tables → spreadsheets
✓ Scrape then extract linked PDFs
✓ Convert documents to datasets
Run lacspace-extract today
Free, open-source, no API keys. It's a CLI and a typed library.
npx lacspace-extract report.pdf