# ScanYourPDF reproducible sample

Prepared October 18, 2026. This is a fictional one-page invoice created for the landing page and guides. The invoice structure was inspired by a user-supplied reference PDF; the reference file, its logo and its invoice data are not copied into these public assets. Names, business details and amounts in this example are synthetic.

The source already contains the text `Alex Example` and the label `Example signature`. Every before/after image therefore shows the same document content. This example demonstrates scan effects; it does not demonstrate adding a signature, a real transaction or an agreement. The current editor separately supports drawing the user's own signature and positioning it on the PDF.

## Files

| File | Contents |
|---|---|
| `source.pdf` | Original text/vector Letter PDF, 612 × 792 points, one page |
| `scanned.pdf` | Light scan effect used by the guides |
| `medium.pdf`, `strong.pdf` | The same source with two more visible effect configurations |
| `landing-scanned.pdf` | Grayscale landing example with visible scan texture and a fixed 2-degree tilt |
| `before.webp`, `after.webp` | Original and light guide result, resized to 918 × 1188 |
| `landing-after.webp` | Direct preview of the landing PDF's processed page image, used by the slider and enlarged sample |
| `medium.webp`, `strong.webp` | Corresponding resized previews |
| `preset.json` | Actual source size, rendered dimensions, full parameters and measured output sizes |

The PDF.js page renderer creates a 1224 × 1584 image at 144 ppi. The production `CanvasScanner` applies the scan effect. The production pdf-lib `buildPDF` routine builds each PDF from the resulting page image. WebP previews are resized directly from those page images, without extra blur, color filters or overlays applied just for the landing page.

The landing uses its own recipe under `landing` in `preset.json`: grayscale, rotation 2 degrees, rotation variance 0, blur 0.45, noise 0.6, brightness 0.97, contrast 1.04, no sepia and no border. The stronger texture and tilt remain visible at the small comparison-card size. The slider, enlarged after view and downloadable landing PDF all use this same processed result. The guide's Light, Medium and Strong presets remain separate and unchanged.

## Regenerate

Install frontend dependencies first and use Node 24. From the repository root:

```sh
node frontend/scripts/generate-scan-demo.mjs
```

To regenerate only the landing result from the existing clean `source.pdf`, preserving `before.webp`, all guide PDFs/previews and their measurements:

```sh
node frontend/scripts/generate-scan-demo.mjs --landing-only
```

The script finds the frontend root from its own file, so it can also run from `frontend/` as `node scripts/generate-scan-demo.mjs`. It starts a Vite server bound to `127.0.0.1:5187`, launches a fresh headless Chrome profile, generates the files and closes the browser/server. Port 5187 must be free.

On macOS, the default Chrome executable is `/Applications/Google Chrome.app/Contents/MacOS/Google Chrome`. For another installation set `CHROME_PATH` to the executable path in the environment before running the command. The generator needs browser access permitted by the execution environment. It sends only its own fictional page output to the local generation endpoint; no account/API/payment credentials are required.

The source dates and all effect settings are explicit. Rotation variance is zero to avoid random page angles. Texture generation and image/PDF encoding can vary by browser/runtime version; reproduce the method and compare visual output rather than promising byte-identical generated PDFs. `preset.json` is rewritten with actual measurements after each run.

After regeneration, update `frontend/src/content/scan-demo.ts` if measured bytes or settings changed, build the frontend and run `npm run check-seo` from `frontend/`. The SEO check compares article measurements with `preset.json` and the actual downloadable file sizes. Inspect all previews and PDFs at 100%, particularly small text, the table, total, signature and page edges.

## Measurements in this revision

Source: 2,147 bytes. Light: 683,743 bytes. Medium: 758,169 bytes. Strong: 931,978 bytes. All three outputs use the same 144 ppi page rendering. These figures are an observation for these files, not a compression benchmark or a prediction for another PDF. The source has compact text/vector instructions; exporting a page image explains its much larger result.

The separate landing PDF is 987,377 bytes at the same rendering resolution. It is a visible demonstration recipe, not the guide's Light preset or a compression claim.

Scan effects rasterize pages: original text selection, links, forms, accessibility structure and existing digital-signature validation are not preserved. No OCR or certificate is added. Downloading these published examples does not consume the user's personal daily document allowance.
