lacspace-extract

Pull text and tables out of PDFs, HTML pages and spreadsheets.

● Live · v0.2.0npm ↗Source ↗
terminal
npx lacspace-extract report.pdf
What it does

Everything, 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.

Features

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.

How to use

Copy, paste, done

Real commands and snippets — from a one-liner to the typed library.

PDF pages + grep
terminal
npx lacspace-extract report.pdf \
  --pages 2-5 --grep "invoice" -i -C 1

Searches only pages 2–5, case-insensitive, 1 line of context, tagged by page.

DOCX → Markdown
terminal
npx lacspace-extract notes.docx -f md -o notes.md

Zero-dep ZIP reader; clean Markdown out.

Slides text, per slide
terminal
npx lacspace-extract deck.pptx --per-page

Emits the text of each slide separately.

Readable article → Markdown
terminal
npx lacspace-extract article.html --readable -f md

Strips chrome and keeps just the article body.

Use it as a library
typescript
import { extractFile, extractPdfText } from "lacspace-extract";
const { text, pageCount } = await extractFile("report.pdf", { pages: "2-5" });
const { tables } = await extractFile("page.html");
Good for

What people build with it

✓ Invoice & statement data

✓ Report tables → spreadsheets

✓ Scrape then extract linked PDFs

✓ Convert documents to datasets

Start now

Run lacspace-extract today

Free, open-source, no API keys. It's a CLI and a typed library.

terminal
npx lacspace-extract report.pdf