Download Latest Version openpublisher5g_amd64-windows.exe (81.1 MB)
Home / 5.21.3
Name Modified Size InfoDownloads / Week
Parent folder
5.21.3_ Per-Page (_Current_) Watermark Persistence _ Independent Multi-Page Stamps source code.tar.gz 2026-11-15 123.1 MB
5.21.3_ Per-Page (_Current_) Watermark Persistence _ Independent Multi-Page Stamps source code.zip 2026-11-15 123.7 MB
README.md 2026-11-15 6.4 kB
OpenPublisher5-i386-windowsXP.exe 2026-11-15 56.5 MB
openpublisher5g_amd64-windows.exe 2026-11-15 81.1 MB
openpublisher5_amd64-windows-portable.exe 2026-11-15 183.2 MB
openpublisher5_amd64-windows.exe 2026-11-15 165.2 MB
openpublisher5_amd64-macos.dmg 2026-11-15 233.1 MB
openpublisher5_amd64-linux.run 2026-11-15 193.4 MB
openpublisher5_amd64-linux.rpm 2026-11-15 215.4 MB
openpublisher5_amd64-linux.flatpak 2026-11-15 153.6 MB
openpublisher5_amd64-linux.deb 2026-11-15 156.2 MB
openpublisher5_amd64-linux.AppImage 2026-11-15 166.4 MB
openpublisher5_amd64-freebsd.pkg 2026-11-15 185.5 MB
Totals: 14 Items   2.0 GB 0

📋 Summary

Version 5.21.3 resolves a document state bug where applying a Current page watermark (scope === 'current') to a second page overwrote and removed the previous Current-page watermark on earlier pages. Watermarks scoped to Current Page Only now persist independently on each page, survive page switching and Undo/Redo history snapshots, and render accurately in multi-page Print and PDF exports.

  1. Per-Page Watermark Storage (page.watermark): Applying a watermark with Current scope now stores the configuration directly on that page object (state.pages[pageIndex].watermark) instead of overwriting the shared document-level state.watermark.
  2. Scoped Modal Inspection & Removal: Opening the Watermark modal on any page initializes controls from that page's resolved watermark (WatermarkEngine.getWatermarkForPage()), and removing a per-page watermark clears only the active page without affecting watermarks on other pages.
  3. History, Sidebar, & Print/PDF Sync: Updated page serialization (serializeCurrentPage) and both Print Engine export passes (print-engine.js) so per-page watermarks persist across page switches, page deletions, Undo/Redo, and vector/raster PDF output.

op-PerPageWatermarkPersistenceAndIndependentMiltiPageStamps


🛠️ Key Improvements

1. Independent Per-Page Watermarks (extensions/watermark-engine.js)

  • applyConfigToState(config) & migrateLegacyCurrentWatermark(): Moved scope === 'current' storage onto state.pages[curIdx].watermark while automatically migrating any legacy single-page state.watermark entries into per-page storage so existing .opub documents stay compatible. Document-wide scopes (all, except-first, first-only) continue to use state.watermark and clear page-level overrides.
  • WatermarkEngine.getWatermarkForPage(pageIndex, totalPages, pageObj): Added a unified resolver that prioritizes page-specific watermarks (page.watermark, or suppresses an explicit { removed: true } marker if overriding a document-wide stamp) before falling back to document-wide rules (shouldApplyToPage).
  • Isolated remove(silent): Removing a watermark on a page with its own current watermark now removes only that page's stamp (and displays Watermark removed from Page N), leaving earlier and later pages untouched. Using silent document reset clears both document-wide and per-page stamps.
  • Scoped Modal State (showModal): Opening Watermark settings pre-populates text, style, tiling, and Remove Watermark button visibility from getWatermarkForPage(curIdx, totalPages).

2. Page Serialization & Undo/Redo Preservation (core/history.js)

  • serializeCurrentPage(): Preserved existingPage.watermark cleanly when serializing the active canvas page during page switches, thumbnail refreshes, .opub saves, and pushHistory() snapshots so switching between Page 1 and Page 2 never drops per-page watermark metadata.
  • Index-Safe Page Reordering/Deletion: Because Current watermarks now live directly on each page object inside state.pages, inserting or deleting earlier pages keeps each remaining page paired with its watermark automatically.

3. Multi-Page Print & Export Accuracy (extensions/print-engine.js)

  • Per-Page Print & Raster Export: Updated both print watermark loops in extensions/print-engine.js to resolve each page's watermark via WatermarkEngine.getWatermarkForPage(...), ensuring multi-page printouts and PDF exports render distinct per-page stamps (e.g., DRAFT on Page 1, CONFIDENTIAL on Page 2, and unwatermarked on Page 3).

🔄 Version Synchronization (v5.21.3)

Component Target Version Updated Reference
Application Assets & Cache Busting v5.21.3 index.html
Service Worker & Cache Store open-publisher-v5-21-3-1 sw.js
Watermark Engine v5.21.3 watermark-engine.js
Print & PDF Export Engine v5.21.3 print-engine.js
AI Assistant Module v5.21.3 ai-assistant.js
UI Interactions & About Dialog v5.21.3 ui-interactions.js
PWA Registration & Templates v5.21.3 pwa-install.js, templates.js
Dashboard, 404 Router, & Badges v5.21.3 dashboard.js, 404.html, README.md

✅ Checklist Completed

  • [x] Fix "Current" page watermark overwrites by storing per-page stamps on state.pages[index].watermark while keeping document-wide scopes on state.watermark
  • [x] Add WatermarkEngine.getWatermarkForPage() resolver and legacy single-page migration for backward compatibility
  • [x] Preserve page.watermark across serializeCurrentPage(), page switches, Undo/Redo history, and page deletions
  • [x] Update Watermark modal initialization and remove() so removing a per-page watermark only clears that page
  • [x] Update Print Engine loops to render per-page watermarks accurately across multi-page documents
  • [x] Live browser E2E verified (Page 1 DRAFT + Page 2 CONFIDENTIAL + unwatermarked Page 3, per-page removal, Undo restore, and page deletion index persistence with zero console errors)
  • [x] Synchronize version strings from 5.21.2 to 5.21.3 across core HTML/JS/SW files and README badges

🚀 Version 5.21.3 - Open Publisher

Source: README.md, updated 2026-11-15