read-pdf

Extracts text and metadata from PDF files or URLs with page-cited evidence.

2|2|Updated Jun 21, 2026
One-click install
npx skills add https://github.com/BTreeMap/SKILLs --skill read-pdf-btreemap
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: read-pdf
Source: https://github.com/BTreeMap/SKILLs/tree/main/read-pdf
Command: npx skills add https://github.com/BTreeMap/SKILLs --skill read-pdf-btreemap

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires pypdf, httpx, btm-corekit, and includes scripts (resource) components.

What problem does it solve? Reading and citing PDFs accurately is hard: agents often paraphrase without page references, mishandle encrypted or scanned documents, or silently guess at scrambled layouts. This Skill extracts text and standard metadata from a PDF file or URL and anchors every answer to a specific PDF page number. ## Core Features & Use Cases - Page-cited extraction: Runs a bundled pypdf-based extractor that emits Markdown with ## PDF page N markers, so every claim in an answer traces to a source page. - Flexible input handling: Accepts local file paths or http(s) URLs, with digest-keyed download caching, a 200 MB size cap, page-range selection (e.g. 1-3,5,8-), and support for encrypted PDFs via an environment-variable password. - Honest limitation reporting: Detects scanned or image-only pages (no OCR), flags ambiguous multi-column layouts, and uses a strict exit-code contract (0 success, 1 fix input, 2 retryable download failure). - Use Case: Ask an agent to summarize a 60-page research paper PDF and quote the methodology section; the response cites exact PDF pages and discloses any pages with no extractable text. ## Quick Start Ask the agent to read the PDF at a given path or URL and answer your question with page citations, for example: summarize paper.pdf and quote the key findings with their page numbers.

Frequently Asked Questions about read-pdf

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I extract text from a PDF with page numbers?

Run the bundled btm-read-pdf command through uv with the PDF path or URL. It prints Markdown with ## PDF page N markers for each page, so every extracted passage can be cited back to its source page.

How do I extract only specific pages from a PDF?

Pass a one-based page selection with --pages, such as 1-3,5,8- for ranges, single pages, and open-ended ranges. The extractor prints only the selected pages plus optional document metadata.

Can I extract text from a PDF URL without downloading it manually?

Yes, pass the http(s) URL directly as the document argument. The extractor downloads it once into a digest-keyed cache, refuses downloads over 200 MB unless --max-bytes is raised, and rejects non-PDF responses like paywall HTML pages.

Does PDF text extraction work on scanned documents?

No, this extractor reads only the PDF text layer and has no OCR. Scanned or image-only pages are marked as having no extractable text, and the tool reports this limitation instead of guessing content.

How do I open a password-protected PDF without sharing the password?

Set the password in a local environment variable in your terminal, then pass only the variable name with --password-env. Owner-locked PDFs with an empty user password open automatically without any password.

Why is extracted PDF text in the wrong reading order?

Multi-column layouts, tables, headers, footers, ligatures, and unusual fonts can scramble text order during extraction. The correct approach is to report the ambiguity and cite the page rather than silently repairing values.