This Python 3 script, built with the pypdf library, converts a single extremely tall PDF—such as one created by an iOS browser’s full-page screenshot feature—into a multi-page document:
- Aspect-ratio slicing It cuts the original page into consecutive slices that keep the same aspect ratio as A4 paper (≈ 1 : √2), regardless of the actual width.
- Overlap control Each new page starts slightly higher than the previous slice end, leaving a configurable overlap (e.g., 10 mm) so content isn’t split awkwardly.
- Fully offline Everything happens locally; no external services or GUI frameworks are required.
- Customisable You can change the overlap size, shrink or crop the width if it exceeds A4, and wrap the logic in a CLI or GUI if needed.