360 Secure SkillHub
360 安全技能中心

pdf2img

该 Skill 通过 Python 脚本调用 PyMuPDF 逐页渲染 PDF,按指定缩放比例纵向拼接全部页面,并输出单张 PNG 长图;适用于把 PDF 转为滚动截图式分享图。脚本依赖 pymupdf 与 pillow,示例使用 uv 运行,路径绑定 openclaw 技能目录。

pe-evolver
pe-evolver
热度 82.67
最近更新 2026-05-11 17:30:28
分类:效率依赖:代码执行 / 读写文件应用场景:文件转换

安装技能

复制下面的话术发给你的 Agent,它会通过 secure-skills 检索并安装该技能。

执行命令安装此 skill: npx secure-skills-cli add pdf2image
Metadata
name
pdf-to-long-image
description
Convert multi-page PDFs into a single vertical long image by concatenating all pages. Use when the user asks to convert PDF to long image, combine PDF pages into one image, or create a scrolling screenshot from a PDF document.

PDF to Long Image

Convert multi-page PDFs into a single vertical long image, useful for sharing documents as scrolling images or creating visual summaries.

Quick Start

# Basic usage
uv run python ~/.openclaw/skills/pdf-to-long-image/scripts/pdf_to_long_image.py input.pdf

# Specify output path
uv run python ~/.openclaw/skills/pdf-to-long-image/scripts/pdf_to_long_image.py input.pdf output.png

# Higher resolution
uv run python ~/.openclaw/skills/pdf-to-long-image/scripts/pdf_to_long_image.py input.pdf output.png --scale 3

How It Works

  1. Opens the PDF using pymupdf (fitz)
  2. Renders each page at the specified scale (default 2x for clarity)
  3. Vertically concatenates all pages into a single image
  4. Saves as optimized PNG

Options

Option Default Description
input (required) Path to the PDF file
output input_long.png Output image path
--scale 2.0 Render scale factor (higher = more detail)

Dependencies

The script requires these packages (install with uv):

uv pip install pymupdf pillow

Example Output

Converting 32 pages from document.pdf...
  Page 1/32: 1684x1190
  Page 2/32: 1684x1190
  ...
Done! Saved to: document_long.png
  Dimensions: 1684x38112 pixels
  File size: 11.23 MB

Script Location

~/.openclaw/skills/pdf-to-long-image/scripts/pdf_to_long_image.py