pdf-vision-reader
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChinesePDF Vision Reader
PDF Vision Reader
図表が多い PDF を画像化して、Claude の vision 機能で内容を解析・Markdown 化するスキルです。
This is a skill that converts PDFs with many diagrams and charts into images, analyzes their content using Claude's vision feature, and converts it to Markdown.
クイックスタート
Quick Start
基本的な使い方
Basic Usage
bash
undefinedbash
undefined1. PDF を画像に変換
1. PDF を画像に変換
wsl python3 scripts/pdf_to_images.py "/mnt/c/path/to/file.pdf"
wsl python3 scripts/pdf_to_images.py "/mnt/c/path/to/file.pdf"
2. 各画像を Read ツールで読み込んで解析
2. 各画像を Read ツールで読み込んで解析
3. Markdown 形式でまとめる
3. Markdown 形式でまとめる
undefinedundefined前提条件
Prerequisites
必要なパッケージ:
bash
undefinedRequired Packages:
bash
undefinedPython パッケージ
Python パッケージ
wsl pip3 install pdf2image Pillow
wsl pip3 install pdf2image Pillow
システムパッケージ (poppler)
システムパッケージ (poppler)
wsl sudo apt-get update
wsl sudo apt-get install -y poppler-utils
undefinedwsl sudo apt-get update
wsl sudo apt-get install -y poppler-utils
undefinedワークフロー
Workflow
ステップ1: PDF を画像に変換
Step 1: Convert PDF to Images
bash
wsl python3 scripts/pdf_to_images.py "/mnt/c/path/to/document.pdf"これにより ディレクトリが作成され、各ページが画像として保存されます:
document_pages/page_001.pngpage_002.pngpage_003.png- ...
bash
wsl python3 scripts/pdf_to_images.py "/mnt/c/path/to/document.pdf"This creates a directory where each page is saved as an image:
document_pages/page_001.pngpage_002.pngpage_003.png- ...
ステップ2: 各画像を解析
Step 2: Analyze Each Image
Read ツールで各画像を順番に読み込み、内容を解析します。
解析時の指示例:
この画像の内容を詳しく説明してください:
- タイトルや見出し
- 本文テキスト
- 図表の説明
- グラフやチャートのデータ
- 重要なポイントUse the Read tool to load each image sequentially and analyze its content.
Example Instructions for Analysis:
Please provide a detailed description of this image's content including:
- Titles and headings
- Body text
- Diagram and chart descriptions
- Graph and chart data
- Key pointsステップ3: Markdown に統合
Step 3: Integrate into Markdown
各ページの解析結果を統合して、一つの Markdown ファイルを作成します。
Integrate the analysis results from each page to create a single Markdown file.
使用例
Usage Examples
例1: プレゼンテーション資料を Markdown 化
Example 1: Convert Presentation Materials to Markdown
User: "presentation.pdf を vision で解析して Markdown 化して"
Assistant:
1. scripts/pdf_to_images.py で PDF を画像に変換
2. 各画像を Read ツールで読み込み
3. 各ページの内容を解析(タイトル、図表、テキスト)
4. 全ページの解析結果を統合
5. Write ツールで Markdown ファイルに保存User: "Analyze presentation.pdf using vision and convert it to Markdown"
Assistant:
1. Convert the PDF to images using scripts/pdf_to_images.py
2. Load each image with the Read tool
3. Analyze each page's content (titles, diagrams, text)
4. Integrate analysis results from all pages
5. Save as a Markdown file using the Write tool例2: 特定のページのみ解析
Example 2: Analyze Specific Pages Only
User: "document.pdf の 5-10 ページだけ解析して"
Assistant:
1. PDF を画像に変換(全ページ)
2. page_005.png から page_010.png のみ Read で読み込み
3. 該当ページの内容を Markdown 化User: "Analyze only pages 5-10 of document.pdf"
Assistant:
1. Convert the PDF to images (all pages)
2. Load only page_005.png to page_010.png using Read
3. Convert the relevant pages' content to Markdown解析の観点
Analysis Perspectives
自動的に抽出する情報
Automatically Extracted Information
各ページの画像から以下を抽出:
-
テキスト情報
- タイトル・見出し
- 本文テキスト
- 箇条書きリスト
- 注釈・キャプション
-
図表
- 図の種類(フローチャート、組織図、etc.)
- 図の説明・要約
- 主要な要素と関係性
-
グラフ・チャート
- グラフの種類(棒グラフ、円グラフ、etc.)
- 軸ラベル
- 主要なデータポイント
- トレンドや傾向
-
テーブル
- テーブルの構造
- ヘッダー行
- データの内容
- Markdown テーブル形式に変換
-
レイアウト・構造
- ページ全体のレイアウト
- セクション分け
- 強調されている情報
The following information is extracted from each page image:
-
Text Information
- Titles and headings
- Body text
- Bullet point lists
- Annotations and captions
-
Diagrams and Charts
- Diagram type (flowchart, organizational chart, etc.)
- Diagram description and summary
- Key elements and relationships
-
Graphs and Charts
- Graph type (bar graph, pie chart, etc.)
- Axis labels
- Key data points
- Trends and patterns
-
Tables
- Table structure
- Header rows
- Data content
- Conversion to Markdown table format
-
Layout and Structure
- Overall page layout
- Section divisions
- Highlighted information
Markdown 出力フォーマット
Markdown Output Format
markdown
undefinedmarkdown
undefined[PDFタイトル]
[PDF Title]
解析日時: YYYY-MM-DD
総ページ数: N
Analysis Date: YYYY-MM-DD
Total Pages: N
Page 1: [ページタイトル]
Page 1: [Page Title]
概要
Overview
[ページの概要説明]
[Page overview description]
主要な内容
Key Content
- [ポイント1]
- [ポイント2]
- [Point 1]
- [Point 2]
図表
Diagrams and Charts
図1: [図のタイトル]
[図の説明]
Figure 1: [Diagram Title]
[Diagram description]
テキスト内容
Text Content
[ページ内のテキスト]
[Page text content]
Page 2: [ページタイトル]
Page 2: [Page Title]
...
undefined...
undefinedスクリプト詳細
Script Details
pdf_to_images.py
pdf_to_images.py
機能:
- PDF の各ページを PNG 画像に変換
- 解像度指定可能(デフォルト: 200 DPI)
- 出力ディレクトリの自動作成
使い方:
bash
python scripts/pdf_to_images.py <pdf_path> [output_dir] [dpi]Features:
- Convert each PDF page to a PNG image
- Configurable resolution (default: 200 DPI)
- Automatic output directory creation
Usage:
bash
python scripts/pdf_to_images.py <pdf_path> [output_dir] [dpi]例
Example
python scripts/pdf_to_images.py document.pdf ./images 300
**出力:**
- `[pdf_name]_pages/page_001.png`
- `[pdf_name]_pages/page_002.png`
- ...python scripts/pdf_to_images.py document.pdf ./images 300
**Output:**
- `[pdf_name]_pages/page_001.png`
- `[pdf_name]_pages/page_002.png`
- ...対応可能なコンテンツ
Supported Content
- ✅ テキスト(日本語・英語)
- ✅ 図表・ダイアグラム
- ✅ グラフ・チャート
- ✅ テーブル
- ✅ スクリーンショット
- ✅ インフォグラフィック
- ✅ 複雑なレイアウト
- ⚠️ 手書きメモ(精度は状況による)
- ⚠️ 低解像度画像(精度低下の可能性)
- ✅ Text (Japanese, English)
- ✅ Diagrams and charts
- ✅ Graphs and charts
- ✅ Tables
- ✅ Screenshots
- ✅ Infographics
- ✅ Complex layouts
- ⚠️ Handwritten notes (accuracy depends on conditions)
- ⚠️ Low-resolution images (possible accuracy reduction)
テキスト抽出との違い
Differences from Text Extraction
pdf-reader (テキスト抽出)
pdf-reader (Text Extraction)
- ✅ テキストのみの PDF で高速
- ✅ 純粋なテキスト抽出
- ❌ 図表は抽出不可
- ❌ レイアウトは簡略化
- ✅ Fast for text-only PDFs
- ✅ Pure text extraction
- ❌ Cannot extract diagrams and charts
- ❌ Layout is simplified
pdf-vision-reader (画像解析)
pdf-vision-reader (Image Analysis)
- ✅ 図表・グラフを理解
- ✅ 複雑なレイアウトを保持
- ✅ ビジュアル要素の説明
- ⚠️ 処理時間が長い
- ⚠️ API コスト(画像解析)
- ✅ Understands diagrams and graphs
- ✅ Preserves complex layouts
- ✅ Describes visual elements
- ⚠️ Longer processing time
- ⚠️ API costs (image analysis)
推奨される使い分け
Recommended Usage
| PDF の種類 | 推奨スキル |
|---|---|
| テキスト中心の文書 | pdf-reader |
| プレゼンテーション資料 | pdf-vision-reader |
| 図表・グラフが多い資料 | pdf-vision-reader |
| 技術図面・設計書 | pdf-vision-reader |
| 論文(図表含む) | pdf-vision-reader |
| 単純なテキストPDF | pdf-reader |
| PDF Type | Recommended Skill |
|---|---|
| Text-focused documents | pdf-reader |
| Presentation materials | pdf-vision-reader |
| Materials with many diagrams/graphs | pdf-vision-reader |
| Technical drawings/blueprints | pdf-vision-reader |
| Research papers (with diagrams) | pdf-vision-reader |
| Simple text PDFs | pdf-reader |
トラブルシューティング
Troubleshooting
pdf2image が見つからない
pdf2image Not Found
bash
wsl pip3 install pdf2imagebash
wsl pip3 install pdf2imagepoppler-utils が見つからない
poppler-utils Not Found
bash
wsl sudo apt-get update
wsl sudo apt-get install -y poppler-utilsbash
wsl sudo apt-get update
wsl sudo apt-get install -y poppler-utils画像変換が失敗する
Image Conversion Fails
- PDF が破損していないか確認
- ディスク容量を確認
- メモリ不足の可能性(大きな PDF は分割処理)
- Check if the PDF is corrupted
- Check disk space
- Possible insufficient memory (split processing for large PDFs)
解析精度が低い
Low Analysis Accuracy
- DPI を上げる(300 推奨)
bash
python scripts/pdf_to_images.py document.pdf ./images 300 - 元の PDF の画質を確認
- Increase DPI (300 recommended)
bash
python scripts/pdf_to_images.py document.pdf ./images 300 - Check the quality of the original PDF
パフォーマンス
Performance
処理時間の目安
Estimated Processing Time
| ページ数 | 画像変換 | 解析(Claude vision) | 合計 |
|---|---|---|---|
| 10ページ | 5秒 | 30-60秒 | ~1分 |
| 30ページ | 15秒 | 90-180秒 | ~3分 |
| 100ページ | 50秒 | 300-600秒 | ~10分 |
| Number of Pages | Image Conversion | Analysis (Claude Vision) | Total |
|---|---|---|---|
| 10 Pages | 5 seconds | 30-60 seconds | ~1 minute |
| 30 Pages | 15 seconds | 90-180 seconds | ~3 minutes |
| 100 Pages | 50 seconds | 300-600 seconds | ~10 minutes |
最適化のヒント
Optimization Tips
-
必要なページのみ処理
- 全ページ変換後、重要なページのみ解析
-
DPI の調整
- 図表が多い: 300 DPI
- テキスト中心: 150-200 DPI
-
バッチ処理
- 複数 PDF を並行処理しない(順次処理)
-
Process Only Necessary Pages
- After converting all pages, analyze only important pages
-
Adjust DPI
- Many diagrams: 300 DPI
- Text-focused: 150-200 DPI
-
Batch Processing
- Do not process multiple PDFs in parallel (process sequentially)
パス変換
Path Conversion
Windows パスから WSL パスへの変換:
- →
C:\Users\.../mnt/c/Users/... - →
D:\Projects\.../mnt/d/Projects/...
Converting Windows Paths to WSL Paths:
- →
C:\Users\.../mnt/c/Users/... - →
D:\Projects\.../mnt/d/Projects/...
関連ツール
Related Tools
- pdf-reader: テキスト中心の PDF 用
- docx-reader: Word 文書用
- OCR ツール: pytesseract(テキスト特化)
- pdf-reader: For text-focused PDFs
- docx-reader: For Word documents
- OCR Tool: pytesseract (text-specialized)
バージョン履歴
Version History
- v1.0.0 (2026-01-06): 初期リリース
- PDF → 画像変換機能
- Vision ベースの解析ワークフロー
- 図表・グラフの理解対応
- Markdown 出力フォーマット
- v1.0.0 (2026-01-06): Initial Release
- PDF to image conversion feature
- Vision-based analysis workflow
- Support for understanding diagrams and graphs
- Markdown output format