| name | pdf-reader |
| description | Read and extract text from PDF files — documents, reports, contracts, spreadsheets. Use whenever you need to read PDF content, not just when explicitly asked. Handles local files, URLs, and WhatsApp attachments. |
| allowed-tools | Bash(pdf-reader:*) |
PDF Reader
Quick start
pdf-reader extract report.pdf
pdf-reader extract report.pdf --layout
pdf-reader fetch https://example.com/doc.pdf
pdf-reader info report.pdf
pdf-reader list
Commands
extract — Extract text from PDF
pdf-reader extract <file>
pdf-reader extract <file> --layout
pdf-reader extract <file> --pages 1-5
pdf-reader extract <file> --pages 3-3
pdf-reader extract <file> --layout --pages 2-10
Options:
--layout — Maintains spatial positioning. Essential for tables, spreadsheets, multi-column docs.
--pages N-M — Extract only pages N through M (1-based, inclusive).
fetch — Download and extract PDF from URL
pdf-reader fetch <url>
pdf-reader fetch <url> report.pdf
Downloads the PDF, verifies it has a valid %PDF header, then extracts text with layout preservation. Temporary files are cleaned up automatically.
info — PDF metadata and file size
pdf-reader info <file>
Shows title, author, page count, page size, PDF version, and file size on disk.
list — Find all PDFs in directory tree
pdf-reader list
Recursively lists all .pdf files with page count and file size.
Scanned PDFs (OCR)
extract and fetch automatically fall back to OCR when pdftotext returns no text (e.g. scanned documents, image-only PDFs). Pages are rendered at 300 DPI via pdftoppm and processed with tesseract (English). No extra flags needed — it happens transparently.
pdf-reader extract attachments/scanned-invoice.pdf
pdf-reader extract report.pdf --pages 1-3
PDF attachments
When a user sends a PDF via WhatsApp or Telegram, it is automatically saved to the attachments/ directory. The message will include a path hint like:
[PDF: attachments/document.pdf]
To read the attached PDF:
pdf-reader extract attachments/document.pdf --layout
Example workflows
Read a contract and summarize key terms
pdf-reader info attachments/contract.pdf
pdf-reader extract attachments/contract.pdf --layout
Extract specific pages from a long report
pdf-reader info report.pdf
pdf-reader extract report.pdf --pages 1-3
pdf-reader extract report.pdf --pages 15-20
Fetch and analyze a public document
pdf-reader fetch https://example.com/annual-report.pdf report.pdf
pdf-reader info report.pdf