Skip to content

Pdf To Image Preview

Verified

Pdf To Image Preview — file & media tool with PNG/JPG support.

64

Install

Claude Code

Add to .claude/skills/

About This Skill

Content available in Chinese

# PDF转图片Skill

任务目标 - 本Skill用于:将PDF文件的每一页转换为独立的图片文件 - 能力包含:PDF文件解析、图片格式转换(PNG/JPG)、可调分辨率输出 - 触发条件:用户需要将PDF转换为图片、提取PDF页面、图片化PDF内容等场景

前置准备 - 依赖说明:scripts脚本所需的依赖包及版本 ``` pymupdf>=1.23.0 ```

操作步骤 - 标准流程: 1. **准备PDF文件** - 确认PDF文件路径(使用 `./` 表示当前工作目录) - 例如:`./document.pdf`

  1. 执行转换
  2. - 调用脚本将PDF文件的每一页转换为图片
  3. - 命令示例:
  4. ```bash
  5. python scripts/convert_pdf_to_images.py \
  6. --input ./document.pdf \
  7. --output-dir ./images
  8. ```
  9. - 可选参数:
  10. - `--image-format`: 图片格式,支持 `png` 或 `jpg`,默认为 `png`
  11. - `--dpi`: 图片分辨率(DPI),默认为 `200`
  12. - `--zip`: 生成ZIP压缩包
  13. - `--zip-output`: ZIP压缩包输出路径(默认:images.zip)
  1. 查看输出
  2. - 图片文件保存在指定的输出目录中
  3. - 文件命名格式:`page_001.png`、`page_002.png`...
  4. - 可选择是否生成ZIP压缩包

资源索引 - 必要脚本:见 [scripts/convert_pdf_to_images.py](scripts/convert_pdf_to_images.py)(用途与参数:PDF转图片脚本)

注意事项 - 输入PDF文件必须存在且可读 - 输出目录必须具有写入权限 - **PDF页数限制**:暂支持100页以内的PDF文件,超过100页请拆分后转换 - 大型PDF文件转换可能需要较长时间,请耐心等待

故障排查 - **脚本找不到错误**:确保在Skill目录下执行,或使用相对路径 `scripts/xxx.py` - **Python版本问题**:确保使用Python 3.6或更高版本 - **依赖缺失**:执行 `pip install pymupdf>=1.23.0` 安装依赖 - **页数超限错误**:PDF文件超过100页,请使用PDF工具拆分为多个小文件

使用示例

示例1:基本转换(PNG格式) ```bash python scripts/convert_pdf_to_images.py \ --input ./report.pdf \ --output-dir ./images ```

示例2:使用JPG格式 ```bash python scripts/convert_pdf_to_images.py \ --input ./document.pdf \ --output-dir ./images \ --image-format jpg ```

示例3:高分辨率输出 ```bash python scripts/convert_pdf_to_images.py \ --input ./document.pdf \ --output-dir ./images \ --dpi 300 ```

示例4:生成ZIP压缩包 ```bash python scripts/convert_pdf_to_images.py \ --input ./document.pdf \ --output-dir ./images \ --zip \ --zip-output ./images.zip ```

示例5:完整配置 ```bash python scripts/convert_pdf_to_images.py \ --input ./report.pdf \ --output-dir ./images \ --image-format jpg \ --dpi 200 \ --zip ```

Use Cases

  • Convert PDF files to other formats (Word, Excel, images) and vice versa
  • Split PDF documents into individual pages or page ranges
  • Compress PDF files to reduce size for sharing and storage
  • Extract text, images, and structured data from PDF files
  • Convert PDF pages to image formats (PNG, JPG) for preview or sharing

Pros & Cons

Pros

  • + Handles multiple file formats for versatile document processing
  • + Local processing preserves privacy — no data sent to external services
  • + Clear documentation makes it easy to get started and integrate

Cons

  • - Requires installing external dependencies before use
  • - Processing large files may require significant memory and disk space
  • - Some advanced features may require additional system-level dependencies

Frequently Asked Questions

What does Pdf To Image Preview do?

Pdf To Image Preview — file & media tool with PNG/JPG support.

What platforms support Pdf To Image Preview?

Pdf To Image Preview is available on Claude Code, OpenClaw.

What are the use cases for Pdf To Image Preview?

Convert PDF files to other formats (Word, Excel, images) and vice versa. Split PDF documents into individual pages or page ranges. Compress PDF files to reduce size for sharing and storage.

Stay Updated on Agent Skills

Get weekly curated skills + safety alerts