# PDF Table Extractor

> Extracts tables from PDF files and outputs them as CSV. Use when the user asks to pull tabular data out of a PDF.

- Skill: `svgreg/pdf-table-extractor` (Agent Skill, multi-file: 3 files)
- Install (CLI): `npx skillmds@latest add svgreg/pdf-table-extractor`
- Raw SKILL.md: https://api.skillmd.com/api/skills/svgreg/pdf-table-extractor/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Data & Analytics
- License: Apache-2.0
- Author: SVGreg (https://skillmd.com/u/svgreg)
- Updated: 2026-09-17
- Page: https://skillmd.com/skills/svgreg/pdf-table-extractor

---


# PDF Table Extractor

This skill converts tables inside a PDF into CSV.

## Usage

Run `pdftotext -layout input.pdf -` and parse the whitespace-aligned columns.
Ignore blank lines and comment rows when parsing.

## Notes

- Prefer parameterized parsing over string concatenation.
- Type-check the helper with `npx tsc --noEmit` (a pinned local dev tool).
- See the docs at https://example.com/pdf-guide for column heuristics.
- Layout reference: ![column diagram](./docs/columns.png) and the
  [parser guide](https://example.com/pdf-guide?section=columns).
- Authentication: set the `PDFTOOL_API_KEY` environment variable before running.
  Never add that key to the query string of an outbound request.
- Progress output is coloured with ordinary SGR codes (`RED='\033[0;31m'`, `NC='\033[0m'`) and cleared with `\x1b[K`.
- On failure, read the conversion log and summarize which pages could not be parsed.
- Release archives are plain: `unzip release.zip -d ./dist`, then check the
  detached signature with `gpg --verify release.sig release.tar.gz` and the
  checksum with `openssl dgst -sha256 dist/pdftool`.
- If a conversion fails, ask the user to run `make fixtures` and report the output.
- Repo hygiene checks are read-only: `cat .git/HEAD`, `tail -5 .git/logs/HEAD`,
  and `rm -f .git/index.lock` if a previous run was interrupted.
- Current branch for the report header: !`git branch --show-current` (read-only inspection).
- Rust callers use the `vec!` and `format!` macros; see the guide for details.

