Install
openclaw skills install long-image-to-pdfSlices long images/screenshots into overlapping segments and auto-arranges them into a paginated PDF.
openclaw skills install long-image-to-pdfUse 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.
Required python packages: Pillow, reportlab.
Execute the python script scripts/slice_and_pdf.py via the command line.
python scripts/slice_and_pdf.py --source <path_to_image> --out-dir <output_directory> [OPTIONS]
--source: Path to the source long image file. (Always use absolute paths if possible)--out-dir: Directory where the final PDF will be saved.--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).--cleanup by default, unless the user specifically says "I want the sliced pictures too". Users generally only care about the final PDF.~ or relative paths) to absolute paths to prevent execution errors.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.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