Pdf To Image Preview

将PDF文件的每一页转换为图片文件;支持自定义图片格式(PNG/JPG)和分辨率;适用于文档处理、图片化存档等场景

MIT-0 · Free to use, modify, and redistribute. No attribution required.
0 · 170 · 1 current installs · 1 all-time installs
by无处不在@wuchubuzai2018
MIT-0
Security Scan
VirusTotalVirusTotal
Benign
View report →
OpenClawOpenClaw
Benign
high confidence
Purpose & Capability
The name/description match the included script: scripts/convert_pdf_to_images.py converts PDF pages to PNG/JPG and supports DPI and ZIP output; the SKILL.md correctly declares the pymupdf dependency. Minor inconsistency: references/usage-guide.md and some examples mention a different script name (pdf_to_images.py) and an --html-output option that is not implemented in the provided script. This appears to be documentation drift rather than a functional mismatch with required capabilities.
Instruction Scope
Runtime instructions are limited and explicit: run the included Python script with input/output paths and optional --zip. The script only reads the specified PDF and writes image files/ZIP in the output dir. There are no instructions to read unrelated files, environment variables, or to send data externally. The only concern is the documentation examples that reference an unimplemented --html-output option and a different script path, which could confuse users but do not expand runtime scope.
Install Mechanism
No install spec is provided (instruction-only plus bundled script). The only dependency is PyMuPDF (pymupdf) which is a normal Python package—no arbitrary downloads, extract actions, or external installers are present in the bundle.
Credentials
The skill requires no environment variables, credentials, or config paths. The script operates on local files only, so the requested environment access is minimal and proportionate to its stated purpose.
Persistence & Privilege
The skill does not request always: true, does not persist configuration, and does not modify other skills or global agent settings. It runs on-demand and has no autonomous persistence requirements.
Assessment
This skill is internally coherent and appears to implement the promised PDF → image functionality without requesting credentials or network access. Before installing: (1) note the docs mismatch — the usage guide mentions a different script name and an --html-output option that the included script does not implement; treat this as a documentation bug. (2) Install pymupdf from a trusted source (pip from PyPI) and run the script in a sandbox or with non-sensitive PDFs first. (3) Respect the 100-page limit and ensure you have write permissions and sufficient disk space. (4) If you need HTML preview generation, either implement it yourself or ask the publisher for the correct script/version. If any unexpected network activity appears when running the script, stop and investigate.

Like a lobster shell, security has layers — review code before you run it.

Current versionv0.1.0
Download zip
latestvk977mmk3h0apmqhzxf5wkjna6582mpe1

License

MIT-0
Free to use, modify, and redistribute. No attribution required.

SKILL.md

PDF转图片Skill

任务目标

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

前置准备

  • 依赖说明:scripts脚本所需的依赖包及版本
    pymupdf>=1.23.0
    

操作步骤

  • 标准流程:
    1. 准备PDF文件

      • 确认PDF文件路径(使用 ./ 表示当前工作目录)
      • 例如:./document.pdf
    2. 执行转换

      • 调用脚本将PDF文件的每一页转换为图片
      • 命令示例:
        python scripts/convert_pdf_to_images.py \
          --input ./document.pdf \
          --output-dir ./images
        
      • 可选参数:
        • --image-format: 图片格式,支持 pngjpg,默认为 png
        • --dpi: 图片分辨率(DPI),默认为 200
        • --zip: 生成ZIP压缩包
        • --zip-output: ZIP压缩包输出路径(默认:images.zip)
    3. 查看输出

      • 图片文件保存在指定的输出目录中
      • 文件命名格式:page_001.pngpage_002.png...
      • 可选择是否生成ZIP压缩包

资源索引

注意事项

  • 输入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格式)

python scripts/convert_pdf_to_images.py \
  --input ./report.pdf \
  --output-dir ./images

示例2:使用JPG格式

python scripts/convert_pdf_to_images.py \
  --input ./document.pdf \
  --output-dir ./images \
  --image-format jpg

示例3:高分辨率输出

python scripts/convert_pdf_to_images.py \
  --input ./document.pdf \
  --output-dir ./images \
  --dpi 300

示例4:生成ZIP压缩包

python scripts/convert_pdf_to_images.py \
  --input ./document.pdf \
  --output-dir ./images \
  --zip \
  --zip-output ./images.zip

示例5:完整配置

python scripts/convert_pdf_to_images.py \
  --input ./report.pdf \
  --output-dir ./images \
  --image-format jpg \
  --dpi 200 \
  --zip

Files

3 total
Select a file
Select a file to preview.

Comments

Loading comments…