ClawKit Logo
ClawKitReliability Toolkit
Back to Registry
Official Verified

long-image-to-pdf

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

skill-install — Terminal

Install via CLI (Recommended)

clawhub install openclaw/skills/skills/byronleeeee/long-image-to-pdf
Or

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

Metadata

Stars4126
Views0
Updated2026-04-15
View Author Profile
AI Skill Finder

Not sure this is the right skill?

Describe what you want to build — we'll match you to the best skill from 16,000+ options.

Find the right skill
Add to Configuration

Paste this into your clawhub.json to enable this plugin.

{
  "plugins": {
    "official-byronleeeee-long-image-to-pdf": {
      "enabled": true,
      "auto_update": true
    }
  }
}
Safety NoteClawKit audits metadata but not runtime behavior. Use with caution.