返回顶部
i

image-to-pdf图片转PDF

Combine multiple image screenshots into a paginated A4 PDF. Intelligently handles page breaks to avoid cutting through text. Use when the user wants to combine, merge, or stitch images/screenshots into a PDF, especially exam papers or documents.

作者: admin | 来源: ClawHub
源自
ClawHub
版本
V 0.1.0
安全检测
已通过
233
下载量
免费
免费
0
收藏
概述
安装方式
版本历史

image-to-pdf

图像转PDF

将多张图像截图(通常是试卷题目)合并为格式规范、分页的A4 PDF,方便直接打印。

使用场景

当用户想要执行以下操作时触发此技能:

  • - 将图像合并/拼接为PDF
  • 将截图整合为可打印文档
  • 从试卷照片或截图创建PDF
  • 将题目图像排列到A4页面进行打印

注意识别以下关键词:拼到一起、合成PDF、拼接、打印、combine images、merge into PDF等。

使用方法

本技能包含一个Python脚本,位于scripts/combine.py(相对于本SKILL.md文件)。

第一步:确定输入和输出

根据用户请求提取以下信息:

  • - 输入:目录路径或图像文件路径列表
  • 输出:所需的PDF输出路径(默认:输入目录下的output.pdf)

第二步:运行脚本

使用uv run自动处理依赖项(无需手动安装):

bash
uv run --with Pillow --with numpy python3 <此技能路径>/scripts/combine.py <输入> -o <输出.pdf>

输入格式:

  • - 目录:python scripts/combine.py ./my_images/ -o result.pdf
  • 多个文件:python scripts/combine.py img1.png img2.png -o result.pdf

可选参数:

  • - --margin <像素>:300dpi下的页面边距像素值(默认:80,约7mm)
  • --no-trim:禁用自动白边裁剪
  • --dpi <数值>:输出DPI(默认:300)

第四步:报告结果

告知用户:

  • - 处理了多少张图像
  • 生成了多少页PDF
  • 输出文件路径

脚本功能说明

  1. 1. 加载图像,自动裁剪白边
  2. 将所有图像缩放到相同宽度(A4可打印宽度)
  3. 将图像紧凑排列到A4页面上(紧密布局,无间隙)
  4. 需要分页时,通过像素分析找到空白行,确保文字不被截断
  5. 输出300 DPI的PDF,可直接打印

标签

skill ai

通过对话安装

该技能支持在以下平台通过对话安装:

OpenClaw WorkBuddy QClaw Kimi Claude

方式一:安装 SkillHub 和技能

帮我安装 SkillHub 和 smart-image-to-pdf-1776123603 技能

方式二:设置 SkillHub 为优先技能安装源

设置 SkillHub 为我的优先技能安装源,然后帮我安装 smart-image-to-pdf-1776123603 技能

通过命令行安装

skillhub install smart-image-to-pdf-1776123603

下载

⬇ 下载 image-to-pdf v0.1.0(免费)

文件大小: 4.77 KB | 发布时间: 2026-4-15 14:26

v0.1.0 最新 2026-4-15 14:26
- Initial release of the image-to-pdf skill.
- Combines multiple image screenshots (e.g., exam papers) into a paginated, print-ready A4 PDF.
- Automatically trims image borders and intelligently places images to avoid splitting text across pages.
- New Python script `scripts/combine.py` added for image processing and PDF creation.
- Simplified usage: one command handles directory or file inputs; options include margins, trimming, and DPI.
- Obsolete file `clawhub.json` removed.

Archiver·手机版·闲社网·闲社论坛·羊毛社区· 多链控股集团有限公司 · 苏ICP备2025199260号-1

Powered by Discuz! X5.0   © 2024-2025 闲社网·线报更新论坛·羊毛分享社区·http://xianshe.com

p2p_official_large
返回顶部