What It Does
The Add PDF Reader skill:- Installs pdftotext CLI tool in container
- Adds PDF reader script for agents
- Auto-downloads PDF attachments from WhatsApp
- Provides tools to extract text, fetch from URLs, and get metadata
- Documents PDF capabilities for agents
Prerequisites
- NanoClaw base installation complete
- Container system configured (Docker or Apple Container)
How to Apply
Apply code changes
The skill runs
npx tsx scripts/apply-skill.ts .claude/skills/add-pdf-reader which:- Adds
container/skills/pdf-reader/with CLI script and docs - Merges
poppler-utilsinstall into Dockerfile - Merges PDF attachment download into WhatsApp channel
- Adds PDF tests to WhatsApp channel tests
What Changes
Files Created
container/skills/pdf-reader/SKILL.md- Agent-facing documentationcontainer/skills/pdf-reader/pdf-reader- CLI script for text extraction
Files Modified
container/Dockerfile- Installspoppler-utils(provides pdftotext)src/channels/whatsapp.ts- Adds PDF attachment downloadsrc/channels/whatsapp.test.ts- Adds PDF download tests.nanoclaw/state.yaml- Records skill application
Usage
WhatsApp PDF Attachments
Send a PDF file in any registered WhatsApp chat:PDF from URL
Local PDF Files
In main channel with project mount:PDF Reader Commands
The agent has access to:PDF attachments are automatically downloaded to
attachments/ in the group workspace. The agent can reference them by filename.Limitations
Text-Based PDFs Only
pdftotext only extracts text from text-based PDFs. For scanned PDFs (images):- Text extraction will be empty
- Consider using agent-browser to open the PDF visually
- Or use OCR tools (not included in this skill)
No Image Extraction
Images in PDFs are not extracted. Only text content is available.Troubleshooting
Agent Says “pdf-reader command not found”
Container needs rebuilding:PDF Text Extraction Is Empty
The PDF may be:- Scanned (image-based) - pdftotext only handles text PDFs
- Encrypted - some encryption blocks text extraction
- Corrupted - check if PDF opens normally
WhatsApp PDF Not Detected
Verify:- Message has
documentMessagefield - MIME type is
application/pdf - WhatsApp connection is active