pdf-vision-reader

Original:🇨🇳 Chinese
Translated
1 scriptsChecked / no sensitive code detected

Converts PDF pages to images and uses vision analysis to extract content including diagrams, charts, and visual elements. Use for PDFs with rich visual content. Requires pdf2image and poppler-utils.

22installs

NPX Install

npx skill4agent add childbamboo/claude-code-marketplace-sample pdf-vision-reader

SKILL.md Content (Chinese)

View Translation Comparison →

PDF Vision Reader

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
# 1. PDF を画像に変換
wsl python3 scripts/pdf_to_images.py "/mnt/c/path/to/file.pdf"

# 2. 各画像を Read ツールで読み込んで解析
# 3. Markdown 形式でまとめる

Prerequisites

Required Packages:
bash
# Python パッケージ
wsl pip3 install pdf2image Pillow

# システムパッケージ (poppler)
wsl sudo apt-get update
wsl sudo apt-get install -y poppler-utils

Workflow

Step 1: Convert PDF to Images

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
  • ...

Step 2: Analyze Each Image

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

Step 3: Integrate into Markdown

Integrate the analysis results from each page to create a single Markdown file.

Usage Examples

Example 1: Convert Presentation Materials to 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

Example 2: Analyze Specific Pages Only

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

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 Output Format

markdown
# [PDF Title]

**Analysis Date:** YYYY-MM-DD
**Total Pages:** N

---

## Page 1: [Page Title]

### Overview
[Page overview description]

### Key Content
- [Point 1]
- [Point 2]

### Diagrams and Charts
**Figure 1: [Diagram Title]**
[Diagram description]

### Text Content
[Page text content]

---

## Page 2: [Page Title]
...

Script Details

pdf_to_images.py

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
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 (Text Extraction)

  • ✅ Fast for text-only PDFs
  • ✅ Pure text extraction
  • ❌ Cannot extract diagrams and charts
  • ❌ Layout is simplified

pdf-vision-reader (Image Analysis)

  • ✅ Understands diagrams and graphs
  • ✅ Preserves complex layouts
  • ✅ Describes visual elements
  • ⚠️ Longer processing time
  • ⚠️ API costs (image analysis)

Recommended Usage

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 Not Found

bash
wsl pip3 install pdf2image

poppler-utils Not Found

bash
wsl sudo apt-get update
wsl sudo apt-get install -y poppler-utils

Image Conversion Fails

  • Check if the PDF is corrupted
  • Check disk space
  • Possible insufficient memory (split processing for large PDFs)

Low Analysis Accuracy

  • 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

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. 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

Converting Windows Paths to WSL Paths:
  • C:\Users\...
    →
    /mnt/c/Users/...
  • D:\Projects\...
    →
    /mnt/d/Projects/...

Related Tools

  • pdf-reader: For text-focused PDFs
  • docx-reader: For Word documents
  • OCR Tool: pytesseract (text-specialized)

Version History

  • 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