Download Latest Version openpublisher5g_amd64-windows.exe (81.1 MB)
Home / 5.9.2
Name Modified Size InfoDownloads / 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
5.9.2_ Printed Text Background Line Spacing _ Zero-Gap Alignment source code.tar.gz 2026-10-17 23.3 MB
5.9.2_ Printed Text Background Line Spacing _ Zero-Gap Alignment source code.zip 2026-10-17 23.6 MB
README.md 2026-10-17 8.4 kB
openpublisher5_amd64-linux.AppImage 2026-10-17 166.4 MB
openpublisher5_amd64-freebsd.pkg 2026-10-17 185.5 MB
Totals: 13 Items   1.8 GB 0

🚀 Summary

Version 5.9.2 resolves an excessive vertical line spacing defect introduced during inline background segmentation in v5.9.1. When printing multi-line text with inline CSS background styling (such as postal addresses or formatted text blocks copied from dark-mode Discord or web editors), the print and PDF engine previously generated an entire empty line gap between every row of text. In contrast, the live Open Publisher editor rendered the lines tightly stacked with normal typographic line spacing where individual background strips virtually touch vertically.

Open Publisher v5.9.2 completely eliminates this discrepancy. The print normalization engine now formats segmented line slices as inherent block-level containers without sibling <br> tags, strips phantom newline characters, applies zero vertical margins and padding, and freezes exact computed pixel widths directly into inline styles prior to rasterization by html2canvas. The resulting print and PDF exports match the live editor view with pixel-perfect fidelity while preserving text box fills, shapes, and gradients.


🔍 Root Cause Analysis & Architecture Solution

1. Root Cause of the Double-Line Spacing in v5.9.1

  • In v5.9.1, splitInlineBackgroundAtBr extracted text prior to each <br> tag into a single-line span, removed the original <br> from the background element, and re-inserted both the extracted span and the <br> tag sequentially into the parent container (parent.insertBefore(fragment, bgEl); parent.insertBefore(br, bgEl);).
  • In both Chromium layout calculation and html2canvas 1.4.1 node parsing, elements with background styling establish independent bounding boxes. When a container element is immediately followed by a sibling <br> tag, the layout engine executes an additional full line advance on top of the container box.
  • This produced an empty line gap between every row of text (equivalent to double line spacing), creating the large gaps reported in v5.9.1 print output.

2. Block-Level Line Segmentation Architecture

  • Complete Elimination of <br> Tags: In splitInlineBackgroundAtBr, <br> tags are completely removed (br.remove()) and never re-inserted into the DOM between line slices.
  • Inherent Block Transformation: Each extracted line slice (and the trailing remainder of the original background element) is explicitly configured as a block box:
  • display: block ensures each line occupies its own independent row naturally without requiring artificial break tags.
  • marginTop: 0px and marginBottom: 0px eliminate block collapsing margins.
  • paddingTop: 0px and paddingBottom: 0px guarantee that the vertical height of each background strip tightly matches the font line-height.
  • lineHeight: inherit ensures the typography matches the editor element precisely.
  • boxSizing: border-box maintains exact dimension constraints.
  • Parent Alignment Inheritance: The normalizer inspects computed textAlign on the parent container (center, right/end, or left) and configures marginLeft and marginRight accordingly (auto for center, auto/0 for right, and 0/auto for left) so multi-line text aligns correctly across all alignment modes.
  • Intentional Blank Line Preservation: If consecutive <br> tags were present in the source text (representing intentional empty lines), an explicit spacer (<div style="height: 1.2em; display: block; margin: 0; padding: 0; width: 100%;"></div>) is inserted to preserve intentional document layout.
  • Phantom Newline Stripping: Text nodes within each line element are sanitized to remove stray \r and \n characters left over from clipboard transfers, preventing browser line wrap engines from registering duplicate breaks.

3. Explicit Pixel Width Freezing for html2canvas

  • html2canvas 1.4.1 does not reliably compute CSS width: fit-content on block elements, frequently falling back to full container width (100%).
  • To guarantee that each line strip tightly hugs its specific text width, splitInlineBackgroundAtBr measures the exact live layout dimensions (textRange.getBoundingClientRect() and line.getBoundingClientRect()) while attached to the DOM in the staging area.
  • The engine calculates the precise content width (including any horizontal padding and borders) and freezes it directly onto line.style.width as an explicit pixel value (e.g. 120px, 105px, 75px).
  • As a result, html2canvas paints each line's background strip to its exact individual text length with zero overflow and zero vertical gaps.

4. Preservation of Real Text Box Fills, Shapes, and Colors

  • Text box fills, gradients, and solid background colors applied via "Format Text Box" reside on .element-content.
  • .element-content, vector shapes ([data-type="shape"]), border art, page borders, and theme containers are strictly excluded from segmentation.
  • Once an inline element is segmented, it receives data-op-line-split="true", preventing Pass 2 (soft wrap inspection) or subsequent passes from re-processing already normalized elements.

📁 Files Modified in 5.9.2

File Changes
extensions/print-engine.js Updated isInlineTextBgCandidate to skip elements marked with data-op-line-split. Rewrote splitInlineBackgroundAtBr to remove sibling <br> tags, convert line slices into zero-gap blocks, inherit text alignment, sanitize text nodes, preserve intentional empty lines, and freeze explicit pixel widths. Added data-op-line-split bypass to splitSoftWrappedInlineBackground. Bumped header to (v5.9.2).
index.html Updated all script, stylesheet, and asset cachebuster queries in <head> and <body> from ?v=5.9.1 to ?v=5.9.2.
sw.js Updated Service Worker cache namespace to open-publisher-v5-9-2 and header to (v5.9.2).
elements/text/text.js Bumped header comment to (v5.9.2).
core/core.js Bumped header comment to (v5.9.2).
core/boot.js Bumped header comment to (v5.9.2).
extensions/legacy-fixes.js Bumped header comment to (v5.9.2).
extensions/ui-interactions.js Bumped header comment and initialization log to (v5.9.2).
ui/menus.js Bumped header comment to (v5.9.2).
ui/sidebar-context.js Bumped header comment to (v5.9.2).
ui/modals/card-sheet-modal.js Bumped header comment to (v5.9.2).
ui/modals/options-modal.js Bumped header comment to (v5.9.2).
tools/proofing/spellcheck-engine.js Bumped header comment to (v5.9.2).

wrapper.html was not modified.


✅ v5.9.2 Verification Checklist

  • [x] Zero Vertical Gaps Between Lines: Verified that multi-line text with inline CSS background styling prints with tight vertical stacking matching the editor, eliminating the double-spacing gap.
  • [x] Individual Line Widths Preserved: Verified that each line retains its own shrink-wrapped background strip width, matching line length rather than expanding to full text box width.
  • [x] Removal of Sibling <br> Tags: Confirmed that <br> tags between split line elements are removed, preventing unintended line advances in html2canvas.
  • [x] Alignment Fidelity: Verified that textAlign (left, center, right) is preserved across all split line blocks via dynamic margin calculation.
  • [x] Explicit Width Freezing: Confirmed computed pixel widths are locked onto line elements prior to html2canvas rasterization, preventing fit-content fallback issues.
  • [x] Intentional Blank Lines Intact: Confirmed that consecutive line breaks in user text generate dedicated spacer elements to preserve formatting.
  • [x] Text Box Fills & Gradients Intact: Confirmed actual text box backgrounds, fills, and gradients on .element-content remain completely unaffected.
  • [x] Shapes & Theme Elements Untouched: Verified shapes, border art, and theme elements are strictly excluded from segmentation.
  • [x] Service Worker & Cachebuster Sync: Verified sw.js cache name is open-publisher-v5-9-2 and asset queries across index.html reference ?v=5.9.2.
  • [x] Subsystem Version Consistency: Confirmed all modified subsystems and modules reflect version 5.9.2.

🎉 Version 5.9.2: Open Publisher

Source: README.md, updated 2026-10-17