# Changelog — Title Block Swapper

## v1.18 — 2026-06-19

- **Changed:** Replacement "of [Customer]" text now uses **DejaVu Sans Bold**
  (embedded via fontkit) instead of the standard Helvetica-Bold font.
  DejaVu Sans Bold is a much closer visual weight match to the original
  Tahoma Bold used in Cannon Equipment prints — Helvetica-Bold was
  noticeably thinner/lighter by comparison.
- **Fixed:** Cover rectangle's left padding reduced from 2pt to 0.5pt. Some
  Cannon prints have thicker title-block border lines (~1.98pt) than others
  (~0.36pt); the previous padding was wide enough to visually clip into the
  thicker borders. Verified clean against both border-width variants.

## v1.17 — 2026-06-18

- **Added:** Single-file shortcut — when only one PDF is queued, the converted
  file downloads directly as a PDF (no ZIP wrapper, no proof sheet). The ZIP
  + proof sheet behaviour is unchanged for batches of 2 or more files.

## v1.16 — 2026-06-15

- **Fixed:** Applied the same `opacity: 1` + enlarged-coverage fix from v1.15
  to the logo cover rectangle. The original Cannon Equipment logo image
  remains embedded in the output file (full removal would require risky
  content-stream rewriting — see Known Limitations), but it is now reliably
  hidden in the final rendered output. Note: a brief "flash" of the original
  logo on initial page load in some PDF viewers is a rendering-order quirk of
  those viewers and is not fully eliminated by this fix.

## v1.15 — 2026-06-15

- **Fixed:** The original "of Cannon Equipment" text was still present in
  the output PDF underneath the white cover rectangle and new "of [Customer]"
  text — pdf-lib only draws additional content, it never removes existing
  content. Some PDF renderers showed this as faint "ghost" text bleeding
  through. Fixed by setting explicit `opacity: 1` on the cover rectangle and
  slightly enlarging it for full coverage.

## v1.14 — 2026-06-12

- **Added:** "Input" card in the right sidebar (between Customer and Output)
  describing the expected file format: Cannon Equipment PDFs with the
  standard title block layout, logo and copyright text in the bottom-right
  corner. No logic changes in this version.

## v1.13 — 2026-06-12

- **Added:** Custom icon (PDF → Amazon title block illustration) as both the
  browser tab favicon and a small icon next to the page title in the header.
  No logic changes in this version.

## v1.12 — 2026-06-12

- **Added:** README and Changelog links in the page header (top-right),
  opening `README_v1.12.md` and `CHANGELOG_v1.12.md` directly. These files
  must be uploaded to the same directory as `index.html` for the links to
  work. No logic changes in this version.

## v1.11 — 2026-06-12

- **Fixed:** Proof sheet thumbnails no longer show drawing content bleeding
  in above the title block. Switched from `pdf-lib drawPage` (which can't be
  clipped) to rendering each page via `pdf.js` to a canvas, cropping to the
  title block region in pixels, and embedding the result as a PNG image.

## v1.10 — 2026-06-12

- **Added:** Version number now displayed in the page header and browser
  tab title, so users can confirm they're on the latest version.

## v1.9 — 2026-06-11

- **Fixed:** "of Amazon" text was vertically misaligned with the rest of the
  copyright block (sitting ~2.3pt too low). Now drawn at the correct text
  baseline (106.0pt from page bottom) instead of the bounding-box bottom.
- **Fixed:** White cover rectangle was slightly too tall and clipped the
  bottom of "the exclusive property" on the line above. Reduced rectangle
  height so it only covers the target line.

## v1.8 — 2026-06-11

- **Fixed:** Text color detection. Previous approaches (page-width heuristic,
  pdf.js text-content color, pdf.js operator-list walking) were all
  unreliable across different prints. Replaced with pixel sampling: the page
  is rendered to a hidden canvas and the actual color at the text position is
  read directly, then matched exactly (black or blue).
- **Fixed:** Proof sheet crop dimensions adjusted (`TB_FROM_BOTTOM` 195 → 165,
  `TB_FROM_RIGHT` 780 → 775) so the crop hugs the title block border more
  tightly.

## v1.7 — 2026-06-11

- **Added:** ZIP file upload support. Users can drop a ZIP containing
  multiple PDFs and they're automatically unpacked and queued. Mixing loose
  PDFs and ZIPs in one drop is supported. Skips macOS `__MACOSX` junk files
  and strips nested folder paths.

## v1.6 — 2026-06-11

- **Fixed:** Logo placement bug — Y-coordinate was using the wrong page-edge
  reference (distance from top instead of bottom in pdf-lib's coordinate
  system), placing the new logo in the wrong location.
- **Fixed:** Proof sheet was rendering nearly-blank thumbnails because the
  crop used 22% of full page height/width scaled down rather than cropping
  to the actual title block region.
- **Fixed:** Font size bug — text size was calculated as a ratio of page
  height, calibrated for A-size sheets. On B-size sheets this produced
  5.4pt text instead of the correct 10.8pt.

## v1.5 — 2026-06-11

- **Fixed:** `NetworkError when attempting to fetch resource` when running
  locally. Replaced `fetch()`-based base64 decoding of the embedded logo
  with a pure `atob()` decoder, which works both locally (`file://`) and
  when served from a web server.

## v1.4 — 2026-06-11

- **Changed:** Embedded the Amazon logo directly into the HTML as a base64
  data URL. Removed the customer-selection dropdown, "Add Customer" modal,
  and `localStorage`-based customer persistence — this build is
  Amazon-only and requires zero setup.

## v1.3 — 2026-06-11

- **Initial release** of the browser-based (no server required) version.
  Built using pdf-lib, JSZip, and FileSaver, deployable as a single HTML
  file to any static web host (e.g. cPanel shared hosting subdomain).
  Includes drag-and-drop upload, customer/logo management via
  `localStorage`, batch processing, ZIP output, and proof sheet generation.

---

*Versions prior to v1.3 were Python-based tools (CLI script and Tkinter
desktop app) — see project history for details.*
