long-image-to-pdf

Slices long images/screenshots into overlapping segments and auto-arranges them into a paginated PDF.

Safety Notice

This listing is from the official public ClawHub registry. Review SKILL.md and referenced scripts before running.

Copy this and send it to your AI assistant to learn

Install skill "long-image-to-pdf" with this command: npx skills add ByronLeeeee/long-image-to-pdf

Long Image to PDF Processor

When to use this skill

Use this skill when the user provides a very long image (like a long chat screenshot or a full webpage capture) and wants to convert it into a well-formatted PDF document.

Prerequisites

Required python packages: Pillow, reportlab.

How to use this skill

Execute the python script scripts/slice_and_pdf.py via the command line.

Command Syntax

python scripts/slice_and_pdf.py --source <path_to_image> --out-dir <output_directory> [OPTIONS]

Required Arguments

  • --source: Path to the source long image file. (Always use absolute paths if possible)
  • --out-dir: Directory where the final PDF will be saved.

Optional Arguments

  • --pdf-name: Name of the output PDF file (default: output.pdf).
  • --slice-height: Height of each slice in pixels (default: 2000).
  • --overlap: Overlap height between consecutive slices in pixels (default: 200).
  • --cols: Number of columns in the PDF (default: 2).
  • --rows: Number of rows in the PDF (default: 2).
  • --layout: Arrangement sequence, either grid (left-to-right) or column (top-to-bottom) (default: grid).
  • --cleanup: Add this flag to automatically delete the intermediate image slices after the PDF is created. (Highly recommended to save disk space unless the user explicitly asks to keep the sliced images).

⚠️ Important Instructions for the Agent (Guardrails)

  1. Always apply --cleanup by default, unless the user specifically says "I want the sliced pictures too". Users generally only care about the final PDF.
  2. Absolute Paths: When constructing the command, resolve any paths (like ~ or relative paths) to absolute paths to prevent execution errors.
  3. DO NOT attempt to read the output PDF: The resulting file is a visual/binary PDF. Do not try to cat, read, or use text-extraction tools on the final PDF to verify it. Just read the command line standard output (STDOUT); if it says STATUS: Success, tell the user the path where the PDF is saved.

Examples

Example 1: Normal conversion (Will auto-cleanup slices, 2x2 grid)

python scripts/slice_and_pdf.py --source "/Users/bob/Downloads/long_chat.png" --out-dir "/Users/bob/Desktop/Output" --cleanup

Example 2: Customizing to 1 column, 3 rows, keeping intermediate slices

python scripts/slice_and_pdf.py --source "/abs/path/webpage.jpg" --out-dir "./results" --cols 1 --rows 3

Source Transparency

This detail page is rendered from real SKILL.md content. Trust labels are metadata-based hints, not a safety guarantee.

Related Skills

Related by shared tags or category signals.

General

Gigo Lobster Resume

🦞 GIGO · gigo-lobster-resume: 续跑入口:v2 stable 当前会清理旧 checkpoint 并从头重跑;保留此 slug 作为旧 checkpoint 兼容入口。 Triggers: 继续试吃 / 恢复评测 / resume tasting / continue lobster...

Registry SourceRecently Updated
General

YiHui CONTEXT MODE

context-mode is an MCP server that saves 98% of your context window by sandboxing tool outputs. It routes large file reads, shell outputs, and web fetches th...

Registry SourceRecently Updated
General

xinyi-drink

Use when users ask about 新一好喝/新一咖啡 drinks, stores, menu, activities, Skill用户大礼包, today drink recommendations, afternoon tea, feeling sleepy, or personalized...

Registry SourceRecently Updated
General

vedic-destiny

吠陀命盘分析中文入口。用于完整命盘研判、命主盘 Rashi chart 与九分盘 Navamsha chart 联读、既往事件回看、出生时间稳定度判断、事业主题、婚姻主题、时空盘专题,以及基于 Jagannatha Hora PDF、星盘截图或文本命盘数据的系统拆盘。当用户提到完整星盘、事业方向、婚姻问题、关系窗...

Registry SourceRecently Updated