| Name | Modified | Size | Downloads / Week |
|---|---|---|---|
| Parent folder | |||
| OpenPublisher5-i386-windowsXP.exe | 2026-10-17 | 56.5 MB | |
| openpublisher5_amd64-windows-portable.exe | 2026-10-17 | 183.2 MB | |
| openpublisher5_amd64-windows.exe | 2026-10-17 | 165.2 MB | |
| openpublisher5_amd64-macos.dmg | 2026-10-17 | 233.1 MB | |
| openpublisher5_amd64-linux.run | 2026-10-17 | 193.4 MB | |
| openpublisher5_amd64-linux.rpm | 2026-10-17 | 215.4 MB | |
| openpublisher5_amd64-linux.flatpak | 2026-10-17 | 153.6 MB | |
| openpublisher5_amd64-linux.deb | 2026-10-17 | 156.2 MB | |
| openpublisher5_amd64-linux.AppImage | 2026-10-17 | 166.4 MB | |
| openpublisher5_amd64-freebsd.pkg | 2026-10-17 | 185.5 MB | |
| 5.9.1_ Print Engine Text Background Normalization source code.tar.gz | 2026-10-17 | 23.3 MB | |
| 5.9.1_ Print Engine Text Background Normalization source code.zip | 2026-10-17 | 23.6 MB | |
| README.md | 2026-10-17 | 7.9 kB | |
| Totals: 13 Items | 1.8 GB | 0 | |
π Summary
Version 5.9.1 resolves a long-standing visual discrepancy between the Open Publisher editor and the print/PDF engine: when users paste rich text styled with CSS backgrounds (such as a multi-line postal address copied from a dark-mode Discord client or web page), the text appears in the editor like highlighted text with neat, per-line background strips tightly hugging each line. However, upon printing (via physical print or "Save as PDF"), the output previously rendered as an opaque, solid dark block filling the entire multi-line rectangular bounding box.
This visual mismatch led users to believe they were printing highlight-style text, only to receive a heavy, solid filled rectangle that obscured spacing and looked like an unintended dark box.
Open Publisher v5.9.1 introduces an inline background segmentation architecture in the print engine that lines up print output to match the editor's live appearance exactly, while strictly preserving all actual text box backgrounds, colors, fills, and gradients.
π Root Cause Analysis & Architecture
1. The Root Cause in html2canvas 1.4.1
- When text is copied from dark-mode applications (such as Discord, Slack, code editors, or browser pages), the clipboard payload contains inline
<span>tags with CSS background styling (e.g.<span style="background-color: rgb(49, 51, 56); color: rgb(219, 222, 225);">Line 1<br>Line 2<br>Line 3</span>). - In modern web browsers, the CSS layout engine fragments inline elements into individual line boxes, painting each line's background only behind that line's glyphs and leaving whitespace and line gaps unpainted.
- In
html2canvas1.4.1, inline box fragmentation is unsupported for backgrounds. During node rendering,html2canvascallsparseBounds(node), which invokesnode.getBoundingClientRect(). For a multi-line inline element, this returns a single union bounding rectangle encompassing all lines from the leftmost character to the rightmost character across the full height of the text block. html2canvasthen fills that entire union rectangle withctx.fillRect(), turning the multi-line text into a solid dark-colored block.
2. The Per-Line Segmentation Engine (normalizeTextBackgroundsForPrint)
- Staging Execution: In
installPhysicalPrintEngine(printFullDocumentDirect), pages are mounted intostagingAreaattached todocument.body(withopacity: 0.01). Because the elements are attached to the live DOM, full CSS layout calculations, computed styles, and client bounding rects are active. - Strict Scope & Exclusion: The normalizer strictly examines descendants of
.element-content. It explicitly skips.element-contentitself (where actual text box fills, colors, and gradients reside), shape elements ([data-type="shape"]), border art, page borders, theme containers, tables, and WordArt. - Pass 1 (Explicit
<br>Line Breaks): - For any inline element with a background containing
<br>tags, the engine uses DOMRange.extractContents()from before the background element to before each<br>. - The extracted slice natively clones and balances all nested formatting tags (
span,font,b,i), moves the text of that line into its own single-line span, and places<br>outside between the split spans. - This eliminates union bounding boxes for pasted multi-line content such as Discord addresses.
- Pass 2 (Soft-Wrapped Multi-Line Spans):
- If any inline background element still wraps across multiple lines without
<br>tags (node.getClientRects().length > 1), the engine scans character bounding rects within text nodes. - When a character's top coordinate indicates a new visual line (
r.top > currentLineTop + 3), a line break boundary is recorded and split, converting the wrapped text into distinct single-line spans. - Outcome: Each line of text is bounded by its own single-line inline element whose
getBoundingClientRect()tightly bounds only that line's text.html2canvaspaints individual per-line background strips matching the editor appearance exactly.
3. Preserving Actual Text Box Backgrounds, Colors, and Gradients
- Text box fills, solid background colors, and gradients configured via "Format Text Box" or the property inspector are applied directly to
.element-content(e.g.content.style.background = ...). - Because
.element-contentis excluded from segmentation andbackground-coloris non-inherited in CSS, actual text box fills and gradients are rendered across the full text box as intended. The segmented text background strips cleanly sit on top of the text box fill, matching the editor in every detail.
π Files Modified in 5.9.1
| File | Changes |
|---|---|
extensions/print-engine.js |
Implemented isInlineTextBgCandidate, splitInlineBackgroundAtBr, splitSoftWrappedInlineBackground, and normalizeTextBackgroundsForPrint. Called normalizeTextBackgroundsForPrint on pageWrapper before html2canvas in printFullDocumentDirect and on scaler in buildPrintDOM. Exported window.normalizeTextBackgroundsForPrint. Bumped header to (v5.9.1). |
io/export/canvas-renderer.js |
Integrated normalizeTextBackgroundsForPrint on cloned page nodes before html2canvas execution in capturePageAsCanvasWithFilters. |
io/export/export.js |
Integrated normalizeTextBackgroundsForPrint on pageWrapper before html2canvas rasterization in exportAsHTML (email export path). |
sw.js |
Updated Service Worker cache namespace to open-publisher-v5-9-1 and header to (v5.9.1). |
index.html |
Bumped all script, stylesheet, and asset cachebusters from ?v=5.9.0 to ?v=5.9.1. |
core/core.js |
Bumped header comment to (v5.9.1). |
core/boot.js |
Bumped header comment to (v5.9.1). |
elements/text/text.js |
Bumped header comment to (v5.9.1). |
ui/menus.js |
Bumped header comment to (v5.9.1). |
ui/sidebar-context.js |
Bumped header comment to (v5.9.1). |
ui/modals/card-sheet-modal.js |
Bumped header comment to (v5.9.1). |
ui/modals/options-modal.js |
Bumped header comment to (v5.9.1). |
tools/proofing/spellcheck-engine.js |
Bumped header comment to (v5.9.1). |
extensions/legacy-fixes.js |
Bumped header comment to (v5.9.1). |
extensions/pwa-install.js |
Bumped header comment to (v5.9.1). |
extensions/ui-interactions.js |
Bumped header comment and initialization log to (v5.9.1). |
wrapper.html was not modified.
β v5.9.1 Verification Checklist
- [x] Pasted CSS Background Printing: Pasted multi-line text with CSS background (e.g. Discord address) prints with individual per-line highlight strips ending at text boundaries instead of a solid dark rectangular block.
- [x] Text Box Fills & Gradients Intact: Actual background colors, fills, and gradients applied to text boxes via
.element-contentremain fully intact and render across the entire text box without interference. - [x] Shape & Theme Elements Untouched: Vector shapes, border art, page borders, and theme containers are strictly excluded from segmentation.
- [x] Native Highlights Aligned: Open Publisher native highlights (
data-opub-hilite="true") and<mark>elements print as crisp per-line strips. - [x] Print Spooler & Export Pipeline Consistency: Normalization is active across direct printing, PDF export, canvas image export, and HTML email export.
- [x] Service Worker & Cachebuster Sync: Verified
sw.jscache name isopen-publisher-v5-9-1and asset query strings inindex.htmlreference?v=5.9.1. - [x] Subsystem Version Consistency: Confirmed all modified subsystems and modules reflect version 5.9.1.
π Version 5.9.1: Open Publisher