image2pdf

A tool to convert one or multiple image files or an image folder into a single PDF, suitable for converting PNG, JPEG/JPG, WebP, TIFF, BMP, or GIF into PDF pages, merging scans or screenshots, preserving explicit input order or naturally sorting directory contents, and adapting images to page sizes such as A4, Letter, or Legal.

Installation

Review the source and dependencies with a prompt. A package is available to download.

Install with an AI assistant

Copy the prompt so your assistant can review the pinned revision and dependencies first.

View promptHide prompt
Check whether SkillPI Skill Finder is installed for your current agent. If it is missing, install and enable it using the official instructions at https://github.com/Findskills/skillpi. Then use Skill Finder to locate and install "image2pdf" from this exact SkillPI detail page: https://skillpi.com/skills/deepskill-7b00d52e49529ed506d43222b8ef96961857db19212e12a3007d7877d8ddfad1. Verify the upstream source and version against https://skillhub.cn/skills/user_a808bed4/image2pdf before installing. If they do not match, stop and report the mismatch. Report the installed path and source version.

Source and setup

skillhub.cn

Setup guidance pending

See the original source for supported tools, dependencies, and permissions.

Installation test pending

A tool to convert one or multiple image files or an image folder into a single PDF, suitable for converting PNG, JPEG/JPG, WebP, TIFF, BMP, or GIF into PDF pages, merging scans or screenshots, preserving explicit input order or naturally sorting directory contents, and adapting images to page sizes such as A4, Letter, or Legal.

0 Downloads

Introduction source: third_party · user_a808bed4 · 1.0.0 Reference

SkillPi interpretation

Tasks
Convert one image, multiple image files, or folders of images into a single PDF. Use when Codex needs to turn PNG, JPEG/JPG, WebP, TIFF, BMP, or GIF files into PDF pages; combine scans, screenshots, photos, or numbered images; preserve explicit input order or naturally sort directory contents; or fit images onto auto-sized, A4, Letter, or Legal pages.
Testing
Not tested

Browse files

Browse files at the source ↗

Original SKILL.md

Open original ↗
Frontmatter
name: image-to-pdf
description: Convert one image, multiple image files, or folders of images into a single PDF. Use when Codex needs to turn PNG, JPEG/JPG, WebP, TIFF, BMP, or GIF files into PDF pages; combine scans, screenshots, photos, or numbered images; preserve explicit input order or naturally sort directory contents; or fit images onto auto-sized, A4, Letter, or Legal pages.

Image to PDF

Use scripts/images_to_pdf.py for deterministic conversion. It accepts files and directories together, applies EXIF orientation, flattens transparency, and writes one image per PDF page.

Workflow

  1. Resolve the requested inputs and output path. Do not modify source images.
  2. Preserve the user's explicit file/directory order. Within each directory, rely on the script's natural filename sort (2.jpg before 10.jpg).
  3. Choose page handling:
    • Use --page-size auto by default to give every image a page matching its dimensions.
    • Use --page-size a4, letter, or legal only when the user requests a uniform paper size or print-ready output.
    • Use --fit contain by default for paper pages. Use fill only when edge cropping is acceptable, or stretch only when distortion is explicitly wanted.
  4. Run the converter with the bundled Codex Python runtime when available; otherwise use python.
  5. Validate the result with pypdf (page count and readable MediaBoxes). For visual confidence, render representative pages with Poppler and inspect them, especially when using paper sizes, margins, transparency, or fill.
  6. Return the final PDF path and state its page count.

Commands

Convert one image:

python scripts/images_to_pdf.py "C:\path\scan.png" -o "C:\path\scan.pdf"

Combine explicit files in the given order:

python scripts/images_to_pdf.py "cover.png" "page2.jpg" "page3.webp" -o "book.pdf"

Combine a directory in natural filename order:

python scripts/images_to_pdf.py "C:\path\images" -o "C:\path\images.pdf"

Create uniform A4 pages with 10 mm margins:

python scripts/images_to_pdf.py "C:\path\images" -o "C:\path\print.pdf" --page-size a4 --margin-mm 10

Use --recursive to include nested directories, --overwrite to replace an existing output, --background white (or another Pillow color) when flattening transparent images, and --dpi to control physical sizing and raster resolution. Run python scripts/images_to_pdf.py --help for all options.

Dependency fallback

The script requires Pillow. If unavailable, install it into the active environment with python -m pip install Pillow. Validation uses pypdf; rendering uses Poppler (pdftoppm) when available.

Safety and quality

  • Refuse an empty input set or an output path that aliases an input image.
  • Do not silently overwrite an existing PDF; add --overwrite only when replacement is intended.
  • Avoid fill for documents containing edge text because it crops.
  • Prefer a light background for screenshots and transparent PNGs unless the user specifies otherwise.

Current listing version

1.0.0

Verify the source revision ↗

Quality assessment

Out of 100 · Assessment report from SkillPi LAB.

Scenario Value85/100

Highlights

  • 解决图像转 PDF 的通用需求,支持 PNG/JPEG/WebP/TIFF/BMP/GIF 等多种格式
  • 适用于扫描件、截图、照片合并等高频场景,实用性强
Trigger Precision95/100

Highlights

  • 触发描述详尽,覆盖多种图像格式和页面尺寸需求
  • 使用场景边界清晰,不易误触或漏触
Structure and Standards95/100

Areas to improve

  • 文档过长 Reported severity: Minor

    SKILL.md 文件共 637 行,超过建议的 500 行限制

    Recommendation: 可考虑将部分命令示例或详细说明移至独立文档,保持主文件简洁

Highlights

  • 结构清晰,包含完整的工作流、命令示例和安全说明
  • 提供多个端到端示例,frontmatter 完整规范
Execution Reliability90/100

Highlights

  • 工具来源明确,参数说明完整,覆盖主要异常场景
  • 具备健全的验证机制(pypdf 校验 + Poppler 渲染)和依赖回退方案
Evidence Verifiability (mean of the first four)91/100

The arithmetic mean of the first four original scores, rounded to a whole number.

Static text checks

100 / 100 · skillpi-20261123-no-r3-v1

No current rules matched the text.

This score reflects rule matches in the text and is provided for reference before use. It excludes attachments and runtime behavior.

Permissions and checks before use

Automatically summarized from this main document. Matches may be examples or defensive advice; they are not actual permission declarations. Attachments, external dependencies and runtime behavior are not covered.

  • Install or fetch external dependencies

    Use official sources and pin versions. Check install scripts in an isolated environment. This document check does not cover code downloaded later.

    Mentioned in main document · lines 52

These notices grant no permissions. Your host tool must still confirm file changes, secrets, external transfers or costs as needed.

Security rating and access scope

safe · Static evidence review; not a runtime safety guarantee.

Before use, confirm and authorize actual file access, external services and network destinations in your host. This review grants no runtime permissions.