> ## Documentation Index
> Fetch the complete documentation index at: https://paperplane-justin-winter-s-projects.vercel.app/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Preview before you pay

> See the exact PDF that will mail before spending anything.

## What you see is what mails

In the composer, after you've written your letter there's a **"See the exact PDF before you pay"** link. It opens the actual PDF the order path will render — same typesetting, same font, same pagination — in a new tab.

This catches the expensive mistakes before money moves:

* A letter that breaks awkwardly across pages.
* A font that reads wrong for the occasion.
* A typo you'd rather fix now than after print.

## The endpoint

The link hits `GET /api/preview`:

```bash theme={null}
curl "https://sendpaperplane.com/api/preview?text=Hello%20world&font=handwritten_casual" \
  -o preview.pdf
```

* `text` — the letter body (capped at 50,000 chars, matching the order path).
* `font` — one of `typed | serif | typewriter | handwritten_casual | handwritten_neat`.

The response is `application/pdf` rendered **by the same `renderTextToPdf` the order path uses** — one code path, so preview can never diverge from what prints.

## Trust model

`/api/preview` is read-only and idempotent: it never creates an order and never mails. It's a safe, linkable render endpoint.
