Snapshot a PDF
Point preset AI at a brand-guidelines PDF. The scanner reads the text for declared hex literals ("Cobalt, #1F47FF"), rasterizes each page, and runs vision-per-page to infer everything the text doesn't declare. The result is the same DesignSystemSnapshot shape the other lanes produce, primitives, semantic tokens, type styles, spacing rhythm, ready to refine into your own system.
When to use the PDF lane
The PDF lane is the right starting point when:
- You're an agency onboarding a client who has a brand-guidelines PDF but no public site or codebase yet.
- You have a brand book that declares colors, type, and spacing in text alongside the visual examples.
- You want exact hex values, not vision-inferred approximations, where the document declares them.
If you have a repo, prefer the codebase lane. If you have a live site, prefer the URL lane. The PDF lane is best for the brand-book-handoff case.
Run the snapshot
From your terminal:
preset snapshot --pdf brand-guidelines.pdf
Typical output:
✓ Reading brand-guidelines.pdf and capturing tokens per page...
✓ Snapshot generated in 42,180ms
Coherence score: 71 / 100
Colors: 14 primitives, 6 semantic roles
Typography: 4 type styles
Spacing: 6 distinct values
Flags
| Flag | Default | What it does |
|---|---|---|
--pdf <path> | required | The PDF file to snapshot. |
--output <file> | stdout | Write the snapshot JSON or narrative to a file instead of stdout. |
--format <type> | narrative | narrative for a readable summary, json for the full snapshot. |
--vision-model <model> | gemini-2.5-pro | Vision model for the per-page inference. Same model set as the image lane. |
--threshold <n> | 1 | Minimum usage count to keep a token. |
--color-threshold <n> | 0.005 | Cluster distance threshold (0-1). |
-v, --verbose | off | Print per-stage timing and observation counts. |
The PDF lane is also available from the workspace dashboard at Bootstrap → Source. The same scanner runs server-side; you don't need a local pdfjs install for the dashboard flow.
What the scanner captures
The PDF lane runs two passes and merges them:
- Text mining. The scanner extracts every text run, looks for
#RRGGBBand#RGBliterals, and walks the immediately-preceding words for a label. A run like "Cobalt, #1F47FF" gives a token namedcobaltwith exact value#1F47FF, surfaced aspdfDeclaredNameson the snapshot. Declared values are authoritative, they aren't re-inferred from pixels. - Per-page vision. Each page is rasterized at 144 DPI and passed through the image lane's vision-LLM + pixel-histogram pipeline. The model identifies palette, type styles, and spacing rhythm visible on the page. The pixel histogram grounds the LLM's color claims against actual page pixels.
The two passes are merged field-by-field: text-declared tokens win on hex values; vision-inferred tokens fill in everything the text didn't claim.
Page cap
By default, the scanner processes the first 15 pages and stops. A typical brand book is 20-40 pages; the first 15 carry the brand-system content (palette, type, logo). Cover pages and voice/copy pages add no token signal.
Vision-per-page cost
Each page makes one LLM call. On Gemini 2.5 Flash that's ~$0.005 per page; on Gemini 2.5 Pro it's higher (the default favors quality over cost). For a 15-page PDF, expect ~$0.07 on Pro or ~$0.075 total on Flash. The CLI never sends pages to a model you didn't pick.
What it cannot capture
| Limitation | Why | Workaround |
|---|---|---|
| Scanned/OCR-only PDFs | Text mining needs real text runs; OCR-on-rendering is unreliable | Use a vector-PDF source (export from Figma, Keynote, or InDesign) |
| Encrypted PDFs | pdfjs can't read encrypted streams | Unlock the file before snapshotting |
| Multi-PDF inputs | V1 processes one PDF per command | Run twice and merge by hand, or pick the canonical brand book |
| Component identity | The scanner sees pages, not components | Use the codebase lane once the system has a codebase |
| Animations, interactions | A PDF is a static document | Use the URL lane once there's a built product |
Accuracy expectations
The PDF lane mixes two signal qualities. Trust them differently:
- Text-declared hexes are exact. If the PDF says
#1F47FF, the snapshot value is#1F47FF. The label recovered from the surrounding words ("Cobalt", "Primary Blue") is also high-confidence: it's literally what the brand team wrote. - Vision-inferred tokens carry the image lane's caveats. Vision is good at "what palette is on this page" and "what type styles appear"; it's noisier on exact spacing values and unable to capture component identity. Treat vision-inferred values as starting points to confirm, not as ground truth.
- Coherence scores apply per-document, not across documents. A 71/100 from one brand book isn't directly comparable to a 71/100 from another. The score reflects internal consistency of what the scanner observed, not absolute design-system maturity.
For most brand-book bootstraps, the PDF lane gives you a workable starter system in ~30-60 seconds for a 15-page document.
How the four lanes compare
| Codebase | URL | Image | ||
|---|---|---|---|---|
| Input | Repo directory | https://... | PNG, JPG, or screenshot | brand.pdf |
| What it reads | AST of components + token sources | Computed styles of every visible element | Pixels via vision LLM + histogram | Text-declared hexes + per-page vision |
| Symbolic names | Direct from source | Recovered from stylesheets (best effort) | Inferred from labels in the image | Mined from text adjacent to hex literals |
| Component identity | Yes | No | No | No |
| Coherence scores | Source-level (truth) | Render-level (observation) | Inference-level (estimate) | Mixed (text exact, vision estimate) |
| Best for | Your own product, deep audit | Reference products, agency onboarding | Brand decks, moodboards, single screens | Brand guidelines, agency client onboarding |
| Speed | ~5s for a mid-size repo | 10-30s per page | 5-10s per image | ~30-60s for 15 pages |
| Cost | Free | Free locally; Browserless quota on the dashboard | LLM tokens (~$0.001 per scan with Gemini Flash) | LLM tokens (~$0.005/page on Flash, hard cap at 15 pages) |