# CCS PDF Editor — Changelog 1.5.3

**Product version:** `1.5.3`  
**Runtime cache-bust:** `config.js` → `1.5.3-forms-refresh-encrypt`  
**Date:** 2026-07-30  
**Owner:** CCS Information Technology  

> **Superseded for current product:** see **[CHANGELOG-1.5.25.md](CHANGELOG-1.5.25.md)** (`1.5.25`). This file remains as the historical 1.5.3 notes.

Internal product development release. Builds on **1.1.1** with multi-document
workflow, more reliable fillable-form export, command-pattern history, and
session restore improvements. Project files remain **`.ccspdf`** with trailer
marker **`---CCS-SAVE-STATE---`** and integrity salt
`CCS-SAVE-HASH-CHECK-S4lT!!` (unchanged — existing projects continue to open).

### Hotfix (same 1.5.3)

- **Hard refresh + `.ccspdf` forms:** session cache now stores the **full** project
  file (including save-state trailer), not only the stripped PDF half. Refresh
  re-applies designer form shells from schema.
- **Password-protected export forms:** QPDF encrypt uses `--modify=all` (form fill
  allowed in readers); form re-import after open supplies password for encrypted
  source bytes.
- **Encrypted open → blank Save PDF/Project:** after unlock, source buffers are
  **decrypted** with QPDF before export (pdf-lib `ignoreEncryption` left page
  content empty).
- **PDF→PDF form loss:** removed global sticky “forms managed” flag that stripped
  AcroForms on unrelated saves; never strip without a form snapshot; sync fill
  values from natives; native-widget snapshot fallback when designer shells missing.
- **forms-fix2:** sticky password must not `qpdf --decrypt` cleartext PDFs (corrupted
  every later save); re-embed keeps catalog `/AcroForm` (`prepareForReembed: true`);
  no strip-to-empty when snapshot is empty.

---

## Highlights

| Area | Change |
|------|--------|
| **Multi-document tabs** | Optional tab bar (`CCS_CONFIG.enableTabbedMode`); each tab keeps its own viewer, zoom, and history |
| **Session restore** | IndexedDB session (`ccs-pdf-editor-session`) with optional PDF byte cache so File-menu opens restore without a FileSystem handle |
| **History** | Instruction-tape history via `processor.js` (opcodes + payloads); undo/redo invert & re-execute |
| **Forms export** | Snapshot designer shells → hard-strip page Widgets → fresh AcroForm → re-embed (KISS path) |
| **Forms restore** | Immediate project apply after render + scheduled `ensureFormsReady` repair passes |
| **OCR** | Scoped to the **active** document viewer only |
| **Chrome** | Numeric version in window title; File → Close / Close All |
| **Config** | Central `config.js` + `?v=` cache-busting script/CSS loader |

---

## Version arc (1.1.1 → 1.5.3)

Approximate internal progression (cache-bust themes):

| Theme | Notes |
|-------|--------|
| Multi-doc + config loader | Tabs, session restore, launch focus-existing |
| Tab event isolation | Workspace-root event delegation |
| Instruction processor | Command-pattern history |
| Strip widgets hard | Export no longer resurrects deleted fields |
| Form group drag | Stencil multi-select in Form mode |
| Forms KISS export | Snapshot → strip → re-embed reliability |
| Form addToPage | Count page widgets; safe geometry; `ga_`-style safe names where needed |
| Forms ready races | No `setTimeout(100)` hope for restore |
| Title / Close menus | Semver digits only; Close / Close All |
| OCR active tab | No cross-tab OCR walks |

---

## Compatibility

- **`.ccspdf` format:** same trailer marker and hash salt as 1.1.x.
- **Deploy layout:** still flat (`js/`, `lib/`, `index.html`, `style.css`, `fonts.css`) for existing Windows / browser packages.
- **WebView2 host bridge:** still `window.__CCS_SHELL__` / open-files messages.
- **New files:** `config.js`, `js/core/idb.js`, `js/core/processor.js`, `js/core/workspace.js`.

---

## Operator notes

1. After deploy, hard-refresh or rely on the new `?v=` cache-bust string.  
2. Multi-tab is **on** by default (`enableTabbedMode: true` in `config.js`).  
3. Rebuild Windows packages with existing `deploy_windows` / `scripts` flows after smoke-testing browser mode.  
4. Smoke test: open fillable PDF → Form mode move field → Save PDF → reopen in a reader; open multi tabs; Save Project `.ccspdf` → reopen.

---

## Files of interest

| Path | Role |
|------|------|
| `config.js` | Feature flags + version |
| `js/core/workspace.js` | Document tabs + session |
| `js/core/processor.js` | Instruction tape |
| `js/core/io.js` | Save project / PDF export (strip + re-embed) |
| `js/overlays/form-fields.js` | Designer shells + workspace modes |
| `js/engine/native-forms.js` | Native AcroForm import / suppress |

Prior backup of 1.1.1 sources (pre-merge): `_backup_pre_1.5.3_*/` at package root (local only; do not ship).
