Install
openclaw skills install image-paginatorSlices long images/screenshots into overlapping segments, adds sequence numbers, and auto-arranges them into a paginated PDF with gaps and page numbers. Supp...
openclaw skills install image-paginator将长截图/长图智能分页为规范 PDF,支持网格切片、页码标注、微信证据排版
场景:微信聊天截图 → 提交法院的证据 PDF
# 1. 律师导出微信聊天记录为长截图
# 2. 一键转换:
python scripts/slice_n_pdf.py "/Users/律师/Desktop/聊天记录.jpg" \
-d "/Users/律师/Desktop" -o "聊天证据_20250105.pdf" --clean
# 3. 直接提交 PDF,打印存档,或发邮件
open "/Users/律师/Desktop/聊天证据_20250105.pdf"
| 场景 | 输入 | 输出 |
|---|---|---|
| 微信聊天证据截图 | 微信长截图(竖向拼接后) | 分页 PDF,含页码+序号 |
| 合同附件超长截图 | 多页合同 PDF 截图拼接 | A4 规范 PDF,可打印 |
| 笔录/判决书截图 | 判决书长截图 | 2×2 网格 PDF,便于阅读 |
| 批量证据材料归档 | 多张证据截图(不同尺寸) | 统一宽度,竖向拼接,分页 |
| 邮件/短信截图证据 | 手机截图 | 带间距 PDF,避免阅读串行 |
- N -1-1、2-3

💡 示意图仅供参考,实际效果取决于截图分辨率和参数设置。
Required python packages: Pillow, fpdf2.
Execute the python script scripts/slice_n_pdf.py via the command line.
python scripts/slice_n_pdf.py <source1> [source2 ...] -d <output_dir> [OPTIONS]
sources (positional): Path(s) to source image(s). Multiple images will be auto-resized to the same width and concatenated in order.-d / --dest: Directory to save the output PDF.-o / --output: Name of the output PDF file (default: output.pdf).--tile: Height of each tile in pixels (default: 2000).--bleed: Bleed / overlap in pixels (default: 200).--cols: Grid columns (default: 2).--rows: Grid rows (default: 2).--gutter: Gap between cells in pixels (default: 40).--edge: Page margin in pixels (default: 25).--no-numbers: Omit page numbers at the bottom.--clean: Remove intermediate tile images after build.- N - footer (disable with --no-numbers).--clean by default unless the user specifically asks to keep tiles.~ and relative paths to absolute paths before running.✓ Done, tell the user the file path.open <path> (macOS).Single long image:
python scripts/slice_n_pdf.py "/Users/bob/Downloads/long_chat.png" \
-d "/Users/bob/Desktop" -o "chat.pdf" --clean
Multiple images with custom grid:
python scripts/slice_n_pdf.py "/Users/bob/Desktop/1.jpg" "/Users/bob/Desktop/2.jpg" \
-d "/Users/bob/Desktop" -o "combined.pdf" \
--cols 2 --rows 2 --gutter 40 --clean
Single column, larger tiles:
python scripts/slice_n_pdf.py "/abs/path/webpage.jpg" \
-d "./results" --cols 1 --rows 3 --tile 3000 --gutter 20 --clean
| 参数 | 默认值 | 说明 |
|---|---|---|
--tile | 2000 | 每格切片高度(像素),建议 ≥ 100 且 > --bleed |
--bleed | 200 | 上下切片重叠高度(像素),必须 < tile |
--cols | 2 | 每页网格列数(1-10) |
--rows | 2 | 每页网格行数(1-10) |
--gutter | 40 | 格子间距(像素) |
--edge | 25 | 页面边距(像素) |
--no-numbers | — | 关闭页码 |
--clean | — | 生成后清理临时切片图 |
⚠️ 参数校验:脚本会自动检查 tile > bleed、cols/rows 在合理范围内、文件存在等,发现问题直接报错退出。
# 方法一:克隆后安装
git clone https://github.com/wux818738-alt/openclaw-skill-image-paginator.git
cd openclaw-skill-image-paginator
bash install.sh
# 方法二:直接下载
curl -fsSL https://github.com/wux818738-alt/openclaw-skill-image-paginator/archive/refs/heads/main.zip -o /tmp/skill.zip
unzip /tmp/skill.zip -d ~/.qclaw/skills/
pip3 install fpdf2 Pillow
安装后直接运行(不需要指定完整路径):
python ~/.qclaw/skills/image-paginator/scripts/slice_n_pdf.py <图片> -d <输出目录>