pdf-reader

Extract text, render pages, and search PDF documents using PyMuPDF.

Updated Aug 19, 2025
One-click install
npx skills add https://github.com/loganmancuso-scout/dotfiles --skill pdf-reader-loganmancuso-scout
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: pdf-reader
Source: https://github.com/loganmancuso-scout/dotfiles/tree/main/dot_pi/agent/skills/pdf-reader
Command: npx skills add https://github.com/loganmancuso-scout/dotfiles --skill pdf-reader-loganmancuso-scout

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires PyMuPDF, and includes scripts (resource) components.

What problem does it solve? Reading PDFs—especially math lecture notes and academic papers—is hard for text-only tools because equations, diagrams, and figures get mangled by plain text extraction. This Skill combines text extraction with page rendering so an AI can both read the text and visually inspect math-heavy or figure-heavy pages. ## Core Features & Use Cases - PDF Triage: Run pdf_info.py to get page count, table of contents, per-page text length, image count, and math density before deciding how to read the document. - Hybrid Reading Strategy: Extract text for cheap structural overview, then render only math- or diagram-heavy pages to PNG images for visual comprehension at configurable DPI. - Targeted Search: Use pdf_search.py with regex or literal queries to locate theorems, definitions, or specific passages with surrounding context lines. - Use Case: Given a 40-page math paper, triage it with pdf_info.py, extract all text for structure, render only the high-math-density pages, and answer questions like "what does theorem 3.2 say" with precise LaTeX statements. ## Quick Start Ask the AI to read and summarize the attached PDF paper, rendering any pages that contain dense equations or figures.

Frequently Asked Questions about pdf-reader

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

FAQPage Schema
How do I extract text from a PDF in Python?

Use PyMuPDF's page.get_text() method to extract text per page. The pdf_extract.py script wraps this with page-range support, accepting specs like 'all', '1-5', or '1,3,7' to extract only the pages you need.

How do I render PDF pages to images for visual inspection?

Use PyMuPDF's get_pixmap with a zoom matrix derived from the target DPI. The pdf_render.py script renders selected pages to PNG files in /tmp at 150 DPI by default, with 200 DPI recommended for dense equations.

How do I search for text inside a PDF file?

Use the pdf_search.py script with a regex or literal query to scan every page's extracted text. It prints each match with the page number, line number, and configurable context lines around the hit.

Why does PDF text extraction mangle equations and math symbols?

PDFs store equations as positioned glyphs rather than structured math, so plain text extraction loses layout and spacing. For math-heavy pages, render the page to an image and read it visually instead of relying on extracted text.

What is the best strategy for reading a very long PDF?

For PDFs over 60 pages, extract text for a structural overview using the table of contents, then use search to find relevant pages and render only those. Rendering every page of a long document consumes too many tokens.