# Turn 100+ Google Stitch Screens into One PDF Storyboard

> Download your Google Stitch screens as ZIPs, run two Python scripts, and get one labelled, high-resolution PDF of the whole app - easy to share and searchable with Ctrl+F.

URL: https://thuyavan.netlify.app/scripts/stitch-to-pdf-storyboard
Updated: 2026-10-07

## Problem
Google Stitch generates great UI/UX designs, but a project with 100+ screens is slow to open, slow to scroll and impossible to share as a single artefact.

## Solution
A two-stage Python pipeline: stage 1 extracts and renames screens from the bulk ZIP exports, stage 2 lays them out on a labelled whiteboard and renders one PDF.

## Result
One lightweight document that gives a high-fidelity bird's-eye view of the whole UI/UX project, ready for clients or quick internal review.

## Input
- Bulk ZIP exports from Google Stitch (each containing screen.png and code.html)

## Output
- image_board_final.pdf – the high-resolution storyboard

## Optional output
- Organised /Screens folder with {index}_{screen_name}_screen.png
- Extracted code.html per screen
- image_order.txt – CSV manifest of the final sequence

## System flow
Stitch ZIPs (Bulk export, unordered) -> process_files.py (Extract · regex-sort · rename) -> /Screens (Numbered PNGs + code) -> image_board.py (ORDINAL_BLOCKS layout · labels) -> Storyboard PDF (Searchable, no-scale render)

## How it works
- **Recursive processing:** Scans the base directory for every .zip archive.
- **Natural numeric sort:** Regex ordering so "Design (2)" always comes before "Design (10)".
- **Targeted extraction:** Hunts only for screen.png and code.html inside each archive.
- **Ordinal blocks:** Define rows such as screens 1–20 in row 1 and 21–30 in row 2, like a real whiteboard.
- **Searchable labels:** Filenames are cleaned into readable labels drawn as real PDF text, so Ctrl+F works.
- **No-scale rendering:** Images keep their original resolution – zero quality loss on an "infinite canvas".

## Configuration
- `BASE_DIR`: Folder holding the Stitch ZIP files (process_files.py).
- `ORDINAL_BLOCKS`: Row/column grouping of screens (image_board.py).
- `Margins & font`: Spacing and label typography of the board.

## How to run
Install dependencies:

    pip install Pillow reportlab
Step 1 – extract & organise:

    python process_files.py
Step 2 – generate the PDF board:

    python image_board.py

## Impact
- Replaces slow browser loading and scrolling with a snappy standard PDF viewer.
- A 100-page UI flow can be shared as a single file through email or Slack.
- Ctrl+F finds any screen by name inside the board.
- Gives stakeholders the full application scope at a glance.

## FAQ
**Can I share all my Google Stitch screens as one file?**
Yes. Stitch exports each design as a ZIP; this pipeline extracts every screen, numbers them, and renders them on one PDF board you can send by email or Slack.

**Does the PDF reduce image quality?**
No. Images are rendered at their original resolution (no-scale rendering), so the board stays sharp when you zoom in.

**Can I search for a screen inside the PDF?**
Yes. Labels are drawn as real PDF text, so Ctrl+F finds screens by name.

**Can I control how screens are grouped into rows?**
Yes. Define ORDINAL_BLOCKS in image_board.py, for example screens 1-20 in row 1 and 21-30 in row 2.

