pdf-vision-reader

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

PDF 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
undefined
bash
undefined

1. 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 形式でまとめる

undefined
undefined

前提条件

Prerequisites

必要なパッケージ:
bash
undefined
Required Packages:
bash
undefined

Python パッケージ

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
undefined
wsl 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.png
  • page_002.png
  • page_003.png
  • ...
bash
wsl python3 scripts/pdf_to_images.py "/mnt/c/path/to/document.pdf"
This creates a
document_pages/
directory where each page is saved as an image:
  • page_001.png
  • page_002.png
  • page_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

各ページの画像から以下を抽出:
  1. テキスト情報
    • タイトル・見出し
    • 本文テキスト
    • 箇条書きリスト
    • 注釈・キャプション
  2. 図表
    • 図の種類(フローチャート、組織図、etc.)
    • 図の説明・要約
    • 主要な要素と関係性
  3. グラフ・チャート
    • グラフの種類(棒グラフ、円グラフ、etc.)
    • 軸ラベル
    • 主要なデータポイント
    • トレンドや傾向
  4. テーブル
    • テーブルの構造
    • ヘッダー行
    • データの内容
    • Markdown テーブル形式に変換
  5. レイアウト・構造
    • ページ全体のレイアウト
    • セクション分け
    • 強調されている情報
The following information is extracted from each page image:
  1. Text Information
    • Titles and headings
    • Body text
    • Bullet point lists
    • Annotations and captions
  2. Diagrams and Charts
    • Diagram type (flowchart, organizational chart, etc.)
    • Diagram description and summary
    • Key elements and relationships
  3. Graphs and Charts
    • Graph type (bar graph, pie chart, etc.)
    • Axis labels
    • Key data points
    • Trends and patterns
  4. Tables
    • Table structure
    • Header rows
    • Data content
    • Conversion to Markdown table format
  5. Layout and Structure
    • Overall page layout
    • Section divisions
    • Highlighted information

Markdown 出力フォーマット

Markdown Output Format

markdown
undefined
markdown
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
単純なテキストPDFpdf-reader
PDF TypeRecommended Skill
Text-focused documentspdf-reader
Presentation materialspdf-vision-reader
Materials with many diagrams/graphspdf-vision-reader
Technical drawings/blueprintspdf-vision-reader
Research papers (with diagrams)pdf-vision-reader
Simple text PDFspdf-reader

トラブルシューティング

Troubleshooting

pdf2image が見つからない

pdf2image Not Found

bash
wsl pip3 install pdf2image
bash
wsl pip3 install pdf2image

poppler-utils が見つからない

poppler-utils Not Found

bash
wsl sudo apt-get update
wsl sudo apt-get install -y poppler-utils
bash
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 PagesImage ConversionAnalysis (Claude Vision)Total
10 Pages5 seconds30-60 seconds~1 minute
30 Pages15 seconds90-180 seconds~3 minutes
100 Pages50 seconds300-600 seconds~10 minutes

最適化のヒント

Optimization Tips

  1. 必要なページのみ処理
    • 全ページ変換後、重要なページのみ解析
  2. DPI の調整
    • 図表が多い: 300 DPI
    • テキスト中心: 150-200 DPI
  3. バッチ処理
    • 複数 PDF を並行処理しない(順次処理)
  1. Process Only Necessary Pages
    • After converting all pages, analyze only important pages
  2. Adjust DPI
    • Many diagrams: 300 DPI
    • Text-focused: 150-200 DPI
  3. 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