zhanghong3721/kimiclaw/pdf-read-file-fallback
Claude Code and agent skill by zhanghong3721/kimiclaw
- community
Checking that the SKILL.md file is still in the repository.
Extract text from PDFs using pdftotext when read_file returns binary data
Install
npx vskill@latest install zhanghong3721/kimiclaw/pdf-read-file-fallbackSKILL.md
The same SKILL.md was published earlier as zhanghong3721/kimiclaw/pdf-read-file-fallback.
PDF Text Extraction Fallback
When to Use
Use this pattern when read_file with filetype="pdf" returns binary image data instead of extractable text content. This commonly occurs with PDFs that contain scanned images or complex formatting.
Steps
1. Attempt Primary Extraction
First, try using read_file:
Important: Use filetype (not file_type) - incorrect parameter naming will cause execution failures.
2. Detect Binary/Image Data
Check if the result contains unusable content:
3. Use pdftotext via run_shell
Extract text using the pdftotext command-line tool:
The - flag outputs to stdout for easy capture. The -layout flag preserves original formatting.
4. Handle pdftotext Unavailable
If pdftotext is not installed, try Python-based extraction:
Complete Example
Notes
pdftotextis part of thepoppler-utilspackage on most Linux systems- For scanned/image-only PDFs, consider OCR tools (tesseract) instead
- Always validate parameter names against tool documentation (
filetypevsfile_type)
Security
- Security scanPassed, 90 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingopenspace/gdpval_bench/skills/pdf-read-file-fallback/SKILL.md
Popularity
- 7-day trend score
- 5
Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/zhanghong3721/kimiclaw/pdf-read-file-fallback)