lacspace-extract

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

● Live · v0.1.0npmSource
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). HTML <table>s become header-keyed rows, and spreadsheets/CSV convert between formats — all through the same export pipeline as the rest of the toolkit. Note: scanned/image PDFs need OCR and aren't supported.

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.

How to use

Copy, paste, done

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

PDF → text
terminal
npx lacspace-extract report.pdf            # print the text
npx lacspace-extract report.pdf -o report.txt

Text-based PDFs (FlateDecode). Scanned PDFs need OCR — not supported.

PDF statement → table as Excel
terminal
npx lacspace-extract statement.pdf --tables -f xlsx -o statement.xlsx

Best-effort, column-aligned tables.

HTML table → CSV
terminal
npx lacspace-extract prices.html -f csv -o prices.csv

Every <table> becomes header-keyed rows.

Use it as a library
typescript
import { extractFile, extractPdfText } from "lacspace-extract";
const { text, pageCount } = await extractFile("report.pdf");
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