agentleFS
BluebagAIBluebagAI/skills/skills/pdf-reader/SKILL.md

pdf-reader

Skill33 starsChanged 12 months agoApache-2.0View on GitHub

WHAT: Read and extract content from PDF files — text, tables, and images. WHEN: the user asks about content in a PDF, mentions a .pdf file, or needs data extracted from technical documents, manuals, specifications, or reports. KEYWORDS: PDF, extract text, extract tables, extract images, pdf reader, document, datasheet, manual, specification, report.

8 other projects use a version of this.

Adopted by

Most recently taken up by

The file

We split this skill into the rules it gives an agent

7 rules. 0 are common, 1 is distinctive, and 6 are very specific to this project.

  • 0

    Common

    Most of the 5 edited versions we read keep these.

  • 1

    Distinctive

    This author's own choices. Worth a look.

  • 6

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Use --max-results 10 and --offset N for pagination.

    line 29
  2. Very specific:

    Use --output file.txt to write to a file instead of stdout.

    line 38
  3. Very specific:

    Use --output file.json for large results.

    line 47
  4. Very specific:

    Use --list-only first to scan, then extract specific pages.

    line 56
  5. Distinctive:

    Use when table extraction doesn't capture a complex layout correctly.

    line 65
  6. Very specific:

    All scripts support --help for full usage details.

    line 78
  7. Very specific:

    Use extract-structure.mjs to get raw positional data and analyze the layout from coordinates.

    line 86

“Common” is measured: kept by at least 6 in 10 of the 5 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

PDF Reader

Extract text, tables, and images from any PDF using pdfjs-dist scripts. All extraction is deterministic — no artificial inference.

Workflow for Large Documents

For documents over ~20 pages, follow this sequence. For short documents, skip to step 3.

1. Understand the document

node scripts/get-info.mjs <pdf>

Returns page count, metadata (title, author, dates), and table of contents.

2. Find relevant pages

node scripts/search-text.mjs <pdf> --query "search term"

Searches all pages. Returns JSON array of matches with page numbers and context. Use --max-results 10 and --offset N for pagination.

3. Extract text from targeted pages

node scripts/extract-text.mjs <pdf> --pages 1-5,10,20

For large documents, --pages is required (unless --all is passed). Use --output file.txt to write to a file instead of stdout.

4. Extract tables

node scripts/extract-tables.mjs <pdf> --page 20

Detects tables by analyzing text positions. Supports --format markdown (default), csv, or json. Use --output file.json for large results.

5. Extract images

node scripts/extract-images.mjs <pdf> --pages 1-30 --list-only
node scripts/extract-images.mjs <pdf> --page 5 --output-dir ./images

Use --list-only first to scan, then extract specific pages. Saves images as PNG.

6. Raw structural analysis (advanced)

node scripts/extract-structure.mjs <pdf> --page 20

Returns every text item with exact x/y coordinates, font info, and dimensions. Use when table extraction doesn't capture a complex layout correctly.

Quick Reference

TaskScriptKey flags
Document infoget-info.mjs
Search textsearch-text.mjs--query, --max-results, --offset
Extract textextract-text.mjs--pages, --all, --output
Extract tablesextract-tables.mjs--page, --format, --output
Extract imagesextract-images.mjs--page, --output-dir, --list-only
Raw positionsextract-structure.mjs--page, --output

All scripts support --help for full usage details.

If text extraction returns empty results

The PDF may be scanned (image-only). Use extract-images.mjs to extract page images instead.

If table extraction misses a table

Use extract-structure.mjs to get raw positional data and analyze the layout from coordinates.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.