← スキル一覧に戻る

pdf-tools
by caiopizzol
⭐ 1🍴 0📅 2026年1月13日
SKILL.md
name: pdf-tools description: Search and extract content from PDF files. Use when searching PDFs, finding text in documents, or extracting specific pages without reading the entire file. allowed-tools: Bash, Read, Glob
PDF Tools
Search and extract content from PDFs without loading entire files into context.
Installation
# macOS
brew install pdfgrep poppler
# Ubuntu/Debian
sudo apt install pdfgrep poppler-utils
Quick Reference
| Task | Command |
|---|---|
| Search | pdfgrep "term" file.pdf |
| Search with page numbers | pdfgrep -n "term" file.pdf |
| Search with context | pdfgrep -n -C 2 "term" file.pdf |
| Get page count | pdfinfo file.pdf | grep Pages |
| Extract pages 5-10 | pdftotext -f 5 -l 10 file.pdf - |
Core Workflow
Step 1: Search - Find where content lives
pdfgrep -n "authentication" large-manual.pdf
# Output: 42: User authentication requires...
# 45: Authentication tokens expire...
Step 2: Extract - Get just those pages
pdftotext -f 41 -l 46 large-manual.pdf -
Search Commands
# Basic search
pdfgrep "search term" document.pdf
# Case-insensitive
pdfgrep -i "search term" document.pdf
# With page numbers
pdfgrep -n "search term" document.pdf
# With context (2 lines before/after)
pdfgrep -n -C 2 "search term" document.pdf
# Count occurrences
pdfgrep -c "search term" document.pdf
# Search all PDFs in directory
pdfgrep -r "term" /path/to/pdfs/
Extract Commands
# Extract specific page range
pdftotext -f 10 -l 15 document.pdf -
# Extract single page
pdftotext -f 42 -l 42 document.pdf -
# Preserve layout (for tables)
pdftotext -layout -f 10 -l 10 document.pdf -
# Extract and limit output
pdftotext -f 10 -l 15 document.pdf - | head -50
Metadata
# Get page count
pdfinfo document.pdf | grep Pages
# Full metadata
pdfinfo document.pdf
Troubleshooting
Empty output from pdftotext: PDF is image-based (scanned). These tools work with text-based PDFs only.
pdfgrep missing matches: Try case-insensitive (-i). Check if PDF has selectable text.
スコア
総合スコア
45/100
リポジトリの品質指標に基づく評価
✓SKILL.md
SKILL.mdファイルが含まれている
+20
○LICENSE
ライセンスが設定されている
0/10
○説明文
100文字以上の説明がある
0/10
○人気
GitHub Stars 100以上
0/15
○最近の活動
3ヶ月以内に更新がある
0/10
○フォーク
10回以上フォークされている
0/5
✓Issue管理
オープンIssueが50未満
+5
○言語
プログラミング言語が設定されている
0/5
○タグ
1つ以上のタグが設定されている
0/5
レビュー
💬
レビュー機能は近日公開予定です