long-image-to-pdf
/install long-image-to-pdf
\r \r
Long Image to PDF Processor\r
\r
When to use this skill\r
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. \r \r
Prerequisites\r
Required python packages: Pillow, reportlab.\r
\r
How to use this skill\r
Execute the python script scripts/slice_and_pdf.py via the command line.\r
\r
Command Syntax\r
python scripts/slice_and_pdf.py --source \x3Cpath_to_image> --out-dir \x3Coutput_directory> [OPTIONS]\r
```\r
\r
### Required Arguments\r
* `--source`: Path to the source long image file. **(Always use absolute paths if possible)**\r
* `--out-dir`: Directory where the final PDF will be saved.\r
\r
### Optional Arguments\r
* `--pdf-name`: Name of the output PDF file (default: `output.pdf`).\r
* `--slice-height`: Height of each slice in pixels (default: `2000`).\r
* `--overlap`: Overlap height between consecutive slices in pixels (default: `200`).\r
* `--cols`: Number of columns in the PDF (default: `2`).\r
* `--rows`: Number of rows in the PDF (default: `2`).\r
* `--layout`: Arrangement sequence, either `grid` (left-to-right) or `column` (top-to-bottom) (default: `grid`).\r
* `--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).\r
\r
## ⚠️ Important Instructions for the Agent (Guardrails)\r
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.\r
2. **Absolute Paths**: When constructing the command, resolve any paths (like `~` or relative paths) to absolute paths to prevent execution errors.\r
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.\r
\r
## Examples\r
\r
**Example 1: Normal conversion (Will auto-cleanup slices, 2x2 grid)**\r
```bash\r
python scripts/slice_and_pdf.py --source "/Users/bob/Downloads/long_chat.png" --out-dir "/Users/bob/Desktop/Output" --cleanup\r
```\r
\r
**Example 2: Customizing to 1 column, 3 rows, keeping intermediate slices**\r
```bash\r
python scripts/slice_and_pdf.py --source "/abs/path/webpage.jpg" --out-dir "./results" --cols 1 --rows 3\r
- Make sure OpenClaw is installed (local or Docker)
- Run the install command in chat:
/install long-image-to-pdf - After installation, invoke the skill by name or use
/long-image-to-pdf - Provide required inputs per the skill's parameter spec and get structured output
What is long-image-to-pdf?
Slices long images/screenshots into overlapping segments and auto-arranges them into a paginated PDF. It is an AI Agent Skill for Claude Code / OpenClaw, with 112 downloads so far.
How do I install long-image-to-pdf?
Run "/install long-image-to-pdf" in the OpenClaw or Claude Code chat to install it in one step — no extra setup required.
Is long-image-to-pdf free?
Yes, long-image-to-pdf is completely free, licensed under MIT-0. You can download, install and use it at no cost.
Which platforms does long-image-to-pdf support?
long-image-to-pdf is cross-platform and runs anywhere OpenClaw / Claude Code is available (cross-platform).
Who created long-image-to-pdf?
It is built and maintained by ByronLeeeee (@byronleeeee); the current version is v1.0.1.