π¦ ClawHub
PDF Reader (Iyeque)
by @iyeque
Extract text, search inside PDFs, and produce summaries.
TERMINAL
clawhub install iyeque-pdf-readerπ About This Skill
name: pdf-reader description: Extract text, search inside PDFs, and produce summaries. homepage: "https://pymupdf.readthedocs.io" metadata: { "openclaw": { "emoji": "π", "requires": { "bins": ["python3"], "pip": ["PyMuPDF"] }, "install": [ { "id": "pymupdf", "kind": "pip", "package": "PyMuPDF", "label": "Install PyMuPDF", }, ], "version": "1.1.0", }, }
PDF Reader Skill
The pdf-reader skill provides functionality to extract text and retrieve metadata from PDF files using PyMuPDF (fitz).
Tool API
The skill provides two commands:
extract
Extracts plain text from the specified PDF file.file_path (string, required): Path to the PDF file to extract text from.
- --max_pages (integer, optional): Maximum number of pages to extract.Usage:
python3 skills/pdf-reader/reader.py extract /path/to/document.pdf
python3 skills/pdf-reader/reader.py extract /path/to/document.pdf --max_pages 5
Output: Plain text content from the PDF.
metadata
Retrieve metadata about the document.file_path (string, required): Path to the PDF file.Usage:
python3 skills/pdf-reader/reader.py metadata /path/to/document.pdf
Output: JSON object with PDF metadata including:
title: Document titleauthor: Document authorsubject: Document subjectcreator: Application that created the PDFproducer: PDF producercreationDate: Creation datemodDate: Modification dateformat: PDF format versionencryption: Encryption info (if any)Implementation Notes
pymupdf) for fast, reliable PDF processingmax_pages optionExample
# Extract text from first 3 pages
python3 skills/pdf-reader/reader.py extract report.pdf --max_pages 3Get document metadata
python3 skills/pdf-reader/reader.py metadata report.pdf
Output:
{
"title": "Annual Report 2024",
"author": "John Doe",
"creationDate": "D:20240115120000",
...
}
Error Handling
π‘ Examples
# Extract text from first 3 pages
python3 skills/pdf-reader/reader.py extract report.pdf --max_pages 3Get document metadata
python3 skills/pdf-reader/reader.py metadata report.pdf
Output:
{
"title": "Annual Report 2024",
"author": "John Doe",
"creationDate": "D:20240115120000",
...
}