| Name | Modified | Size | Downloads / Week |
|---|---|---|---|
| Parent folder | |||
| 5.1.4_ Physical Measurement Units, DPI Conversion _ Print Engine Precision source code.tar.gz | 2026-09-25 | 21.5 MB | |
| 5.1.4_ Physical Measurement Units, DPI Conversion _ Print Engine Precision source code.zip | 2026-09-25 | 21.7 MB | |
| README.md | 2026-09-25 | 28.6 kB | |
| openpublisher5_amd64-windows-portable.exe | 2026-09-25 | 183.2 MB | |
| openpublisher5_amd64-windows.exe | 2026-09-25 | 165.2 MB | |
| openpublisher5_amd64-macos.dmg | 2026-09-25 | 233.1 MB | |
| openpublisher5_amd64-linux.run | 2026-09-25 | 193.4 MB | |
| openpublisher5_amd64-linux.rpm | 2026-09-25 | 215.4 MB | |
| openpublisher5_amd64-linux.flatpak | 2026-09-25 | 153.6 MB | |
| openpublisher5_amd64-linux.deb | 2026-09-25 | 156.2 MB | |
| openpublisher5_amd64-linux.AppImage | 2026-09-25 | 176.6 MB | |
| openpublisher5_amd64-freebsd.pkg | 2026-09-25 | 185.5 MB | |
| Totals: 12 Items | 1.7 GB | 0 | |
🚀 Summary
Version 5.1.4 introduces a centralized physical measurement unit (Inches, Centimeters, Millimeters, Pixels) and DPI resolution conversion subsystem across Open Publisher. Users can now design and resize documents using real-world physical print measurements with live unit conversions, customized DPI resolutions, and intelligent format detection.
This update also resolves key printing, asset insertion, and multi-page viewport issues:
- Multi-Sheet Print Slicing & Blank Page Elimination: Fixed print dialog spanning single-page documents across multiple sheets (e.g. 3 sheets) when printing at high DPIs (such as 300 DPI) by calculating
@pagedimensions using active document DPI. Furthermore, eliminated blank pages being injected between pages and at the end of print jobs by preventing sub-pixel rounding overflow, enforcing canonical preset dimensions, and applying strict page-break control. - Image and Clipart Insertion Failure: Fixed crash caused by an undeclared
dropCoordsvariable inextensions/smart-images.js. - Print Spooler Hang: Resolved hangs on "Rendering page 1 of 1..." by adding strict image completion checks, safety timeouts, and scale fallback to
extensions/print-engine.js. - DPI-Aware Multi-Page View & Adaptive Zoom: Fixed multi-page view prematurely triggering at 20% zoom on 300 DPI documents (where 20% zoom represents normal single-page fit) by calculating activation threshold dynamically relative to document DPI (
0.45 * (96 / dpi)= 14.4% at 300 DPI). Added adaptive fine-grain zoom stepping and scaled multi-page gaps, borders, and labels.
🌟 Special Thanks & Acknowledgements
- lucastucious: For requesting and defining the physical measurement conversion requirements and workflow concepts.
- Tallulah95: For the UI design and element positioning choices.
- Gemini 3.8: For the mathematics, and Playwright verification.
🔍 Root Cause Analysis & Architecture
- Multi-Sheet Print Spanning at 300 DPI & Blank Page Insertion:
- At 300 DPI, an A4 page canvas has pixel dimensions of 2480px x 3508px (8.267" x 11.693" * 300 DPI).
- In
extensions/print-engine.js, physical@pagedimensions were originally hardcoded to(masterPW / 96)and(masterPH / 96). - When printing a 300 DPI A4 document, the printer was instructed that the page measured
2480 / 96 = 25.833 incheswide by3508 / 96 = 36.542 inchestall (a giant poster format). - Because 36.542 inches exceeds standard A4 paper height (11.69 inches) by 3.125x, the browser printer paginated the single page across 3 sheets of paper, slicing images in half.
- Blank Page Injection: When floating-point round-up produced
11.693in(297.0022mm), it fractionally exceeded exact printer driver A4 height (297.0000mm) by 0.0022mm (sub-pixel overflow). Chromium paginated this tiny fraction into a new blank sheet, and unconditionalpage-break-after: always;forced another break, resulting in an empty sheet between pages and after the final page. - Fixed 0.45 Multi-Page Activation Threshold:
- In
canvas/canvas.js,updateMultiPageView(z)hardcodedconst THRESHOLD = 0.45;(45% zoom). - At 96 DPI, fitting a single A4 page on screen uses ~60% zoom, so multi-page view correctly activated only when zooming down to 45% or below.
- At 300 DPI, an A4 page is 2480px x 3508px, requiring ~18% to 20% zoom just to fit the single page on screen.
- Because 20% is less than 45%, multi-page view was immediately triggered when the user was simply viewing their active page!
- In addition, zoom controls and
fitToPage()were hard-clamped toMath.max(0.2, ...)which prevented smooth overview zooming below 20%. - Fixed-Pixel UI Indicators & Thresholds: Both
renderPage()incore/pages.jsandinitFormatIndicator()inextensions/ui-interactions.jspreviously relied on rigid pixel-range thresholds rather than ratio-aware and DPI-aware format matching. - Clipart and Image Insertion Failure: In
extensions/smart-images.js,window.insertSmartImagedid not declaredropCoordsin its parameter signature. Whenimg.onloadevaluatedif (dropCoords && ...), JavaScript threwReferenceError: dropCoords is not defined, halting DOM insertion. - Print Engine Spooler Hang: In
extensions/print-engine.js,img.src = finalSrcwas prematurely assigned beforeloadImageStrict. In Chromium, re-assigning identical data URLs or cached images does not fireonloadonceimg.completeis already true. BecauseloadImageStrictlacked animg.completebypass and timeout, the print promise waited indefinitely.
🛠️ Enhancements & Fixes
1. DPI-Aware Print Engine & Blank Page Elimination (extensions/print-engine.js)
- Replaced hardcoded
masterPW / 96withmasterPW / masterDpi. - Automatically resolves master page DPI from
page.dpi,state.dpi, or canvas aspect heuristics. - Integrated canonical preset physical dimensions via
UnitConversionService.PRESETS(e.g., A4: 8.268" x 11.692"). - Height dimension protection: applies
calc(${heightInches}in - 1px)to eliminate sub-pixel rounding overflow into blank sheets. - Added strict
page-break-inside: avoid !important; break-inside: avoid !important;to.pageelements and zero font-size / line-height resets. - Conditioned inline page breaks so the final page uses
page-break-after: avoid; break-after: avoid;rather than unconditionally forcing a page break. - Configured
.page:last-childwithbreak-after: avoid !important; page-break-after: avoid !important;in the print stylesheet. - Physical
@pagedimensions for an A4 page at 300 DPI now evaluate correctly to standard paper dimensions, fitting exactly onto 1 sheet of paper in the printer dialog without tiling, slicing, or blank pages. - Updated
html2canvasprint capture scale to dynamically target ~300 DPI output (Math.round(300 / pageDpi)), avoiding gigantic 80-megapixel canvases when the document is already designed at 300 DPI. - Fixed rotated page dimensions in mixed-orientation documents to use physical inch dimensions.
- Updated sidebar thumbnail badge in
core/pages.jsto calculate physical inches based onpage.dpi.
2. Centralized Math & Physical Unit Conversion Service (core/units.js)
- Introduced
window.UnitConversionServicehandling bidirectional conversions between: - Inches (
in):Pixels = Inches * DPI - Centimeters (
cm):Pixels = (cm / 2.54) * DPI - Millimeters (
mm):Pixels = (mm / 25.4) * DPI - Pixels (
px): direct 1:1 mapping - Physical preset dimensions supported:
- A4: 210mm x 297mm (8.27" x 11.69")
- Letter: 8.5" x 11" (215.9mm x 279.4mm)
- A3: 297mm x 420mm (11.69" x 16.54")
- A5: 148mm x 210mm (5.83" x 8.27")
- Legal: 8.5" x 14" (215.9mm x 355.6mm)
- Tabloid: 11" x 17" (279.4mm x 431.8mm)
- Business Card: 3.5" x 2" (88.9mm x 50.8mm)
- Square: 210mm x 210mm (8.27" x 8.27")
- DPI presets: 96 DPI (Standard Web / CSS default), 72 DPI (Draft / Screen), 140 DPI (Medium Resolution), 150 DPI (Medium Print), 300 DPI (High-Resolution Print), plus Custom numerical entry.
- Added
detectFormat(w, h, dpi): DPI-aware and aspect-ratio-aware format classifier that accurately identifies page formats across any chosen DPI or orientation.
3. Multi-DPI Format Detection Fix (core/pages.js & extensions/ui-interactions.js)
- Replaced the hardcoded pixel threshold checks (
shortEdge >= 1100) withUnitConversionService.detectFormat(w, h, dpi). - Eliminates the bug where selecting A4, Letter, or other page formats incorrectly flipped the UI indicator to A3.
- Page format indicator icon on the ribbon now correctly reflects A4, Letter, A3, A5, Legal, Tabloid, Business Card, and Square across all resolutions.
4. Upgraded "New Document" Dialog (core/pages.js)
- Complete modal setup replacing the simple confirmation prompt:
- Quick format preset selector buttons (A4, Letter, A3, A5, Legal, Tabloid, Business Card, Square).
- Orientation toggle (Portrait / Landscape) with automatic dimension swapping.
- Units dropdown (Inches, Centimeters, Millimeters, Pixels) with live numeric conversion on change without altering physical size.
- DPI resolution selector with custom numeric input.
- Real-time canvas pixel preview banner (e.g.
Resulting Canvas: 794 x 1123 px at 96 DPI, Portrait).
5. Upgraded "Resize Document" Dialog (layout/document.js)
- Interactive resizing with physical unit conversion:
- Preset format buttons for instant standard sizes.
- Units selector with live on-the-fly dimension recalculation.
- DPI resolution selector with custom numerical input.
- Live preview indicator showing resulting canvas pixel dimensions.
- Updates canvas dimensions, active page DPI, orientation, sidebar thumbnails, and undo/redo history.
6. Custom Margins & Ribbon Margins Integration (layout/document.js & index.html)
- Custom Margins Dialog: Allows entering margins in physical units or pixels, converts dynamically between units, and calculates absolute canvas pixels based on
MarginPixels = MarginInches * DocumentDPI. - Ribbon Margin Presets: Normal (0.5"), Narrow (0.25"), Moderate, Wide (1"), and Zero (0") now use
setMarginPresetInches()to scale margins dynamically based on active document DPI.
7. Clipart and Image Insertion Reliability (extensions/smart-images.js)
- Updated
window.insertSmartImagesignature to(imageSrc, fallbackSrc, dropCoords = null). - Eliminates
ReferenceError: dropCoords is not defined. - Restores Ribbon Picture upload, Drag-and-Drop image insertion, Web Clipart modal imports, and clipboard paste (Ctrl+V).
- Added immediate
img.completecheck for synchronously resolved data URLs. - Wrapped element creation in a
try/catchblock to guarantee spinner cleanup.
8. Print Engine Hang Resolution (extensions/print-engine.js & core/pages.js)
- Overhauled
loadImageStrict: - Added immediate resolution if
imgEl.completeandimgEl.naturalWidth > 0. - Added a 2.5-second safety timeout so missing assets never lock the print pipeline.
- Removed premature
img.src = finalSrccall prior toloadImageStrictandbakeImageForPrint. - Updated
bakeImageForPrintwith a 3-second safety timeout and fast-path resolution for data URLs. - Added a 2-second timeout to background texture preloading.
- Added
imageTimeout: 4000and a 12-secondPromise.racefallback to scale 2 rendering onhtml2canvas. - Corrected fallback DPI in
core/pages.js,io/file-io.js, andio/publisher-file-loader.jsto 96 DPI.
9. DPI-Aware Multi-Page View & Adaptive Zoom (canvas/canvas.js & canvas/interaction.js)
- Replaced the fixed 0.45 zoom threshold with
window.getMultiPageThreshold(pageDpi) = 0.45 * (96 / pageDpi). - At 96 DPI: activates at <= 45% zoom.
- At 300 DPI: activates at <= 14.4% zoom. This allows an A4 300 DPI page at 20% zoom to remain in clean single-page editing view without unwanted multi-page triggering.
- Scaled multi-page layout gaps (
30px * dpiRatio), wrapper padding, slot borders, and page labels (13px * dpiRatio) bypageDpi / 96so multi-page view maintains identical optical proportions on screen across all DPIs. - Created
zoomStepOut()andzoomStepIn()with adaptive optical step increments: state.zoom < 0.25: 2% step (0.02) for high-precision control on high-DPI canvases.state.zoom < 0.50: 5% step (0.05).- Normal zoom: 10% step (0.10).
- Updated minimum zoom clamp across mouse wheel, Ctrl+-, zoom slider,
fitToPage(), andfitToWidth()toMath.max(0.02, 0.2 * (96 / pageDpi)). At 300 DPI, minimum zoom extends down to 6.4%, enabling full-page fit and overview zoom on any display resolution. - Updated
zoom-slidermin to 5% with dynamic bounds.
10. Physical-Scale DPI Rulers & Centimeter Default (canvas/canvas.js, ui/menus.js, layout/document.js, core/pages.js, io/file-io.js, io/publisher-file-loader.js)
- Metric Centimeter Default:
- Global
state.unitandstate.rulerUnitdefault to Centimeters (cm), matching standard A4 dimensions (21.0 cm x 29.7 cm). - Page Setup dialogs (
changeSize()andhandleNewDocument()) now default to Centimeters (cm) and do not alterstate.rulerUnit. - The canvas ruler consistently displays centimeters, counting from 0 to 21 cm across an A4 page, up to 29.7 cm (30 cm) vertically, and past 30 cm across the pasteboard regardless of document DPI.
- DPI-Aware Physical Scaling:
- Replaced the hardcoded 96 DPI formula (
pxPerMm = 37.795275 / 10) with dynamic resolution calculations:- Metric (
cm/mm):pxPerMm = pageDpi / 25.4 - Imperial (
in):pxPerUnit = pageDpi - Screen (
px):pxPerUnit = 1
- Metric (
- An A4 page (210mm x 297mm) at 300 DPI (2480px x 3508px) now accurately aligns at 21.0 cm on the horizontal ruler and 29.7 cm on the vertical ruler, matching the 96 DPI physical readout.
- Multi-Unit Ruler Support & User Selection:
- Added
window.setRulerUnit(unit)supporting Centimeters (cm), Inches (in), Millimeters (mm), and Pixels (px). - Added unit selection options with active checkmarks to the ruler context menu (right-click on horizontal or vertical ruler).
- The ruler remains in Centimeters by default and only switches units if explicitly selected by the user via the ruler context menu (
state._userExplicitRulerUnit). - Adaptive Optical Level of Detail (LOD):
- Scaled tick density and label steps using
effectiveZoom = zoom * (pageDpi / 96). At 300 DPI (viewing zoom ~0.15 to 0.25), labels are drawn every 1 cm so every centimeter from 0 to 30 is clearly readable. - Automatic Synchronization:
- Connected
window.syncRulers()torenderPage(),setPageSize(),changeSize(), andtoggleOrientation(). - Publication Persistence:
- Serialized
rulerUnitandrulerUnitExplicitinto.opubfiles and restored them during publication load.
11. DPI-Invariant Margins & Resolution Scaling (core/core.js, layout/document.js, core/pages.js, canvas/canvas.js, io/file-io.js, io/publisher-file-loader.js, extensions/system-patches.js)
- Root Cause:
state.marginswas previously stored as fixed 48px raw canvas units.- At 96 DPI, 48px is 0.5 inches (1.27 cm), or 6.04% of an A4 page width (794px).
- When changing document resolution to 300 DPI, an A4 page became 2480px wide. Because
state.marginswas not scaled, it remained 48px (only 0.16 inches / 1.93% of the page width). On screen, the green dotted margin rectangle collapsed inward against the paper edge. - Resolution-Aware Scaling & Synchronization:
- In
layout/document.js: When DPI changes inchangeSize(),state.marginsis scaled proportionally byd / oldDpi(e.g. 48px * 300 / 96 = 150px),state.marginsDpiis updated tod, and both#paper .margin-guidesand#margin-guide-overlayare immediately updated. - In
core/core.js: Initializedmargins: { top: 48, right: 48, bottom: 48, left: 48 }andmarginsDpi: 96in globalstate. - In
core/pages.js: InrenderPage(), ifpageDpi !== state.marginsDpi,state.marginsis scaled to matchpageDpiand updated in the.margin-guidesDOM element. InhandleNewDocument(), initializedstate.marginstoMath.round(0.5 * d)(150px at 300 DPI) andstate.marginsDpi = d. - In
canvas/canvas.js: InsyncMarginGuideOverlay(), fallback margins calculate dynamically usingMath.round(0.5 * curDpi). - In
layout/document.js:showCustomMarginsModal(),setMarginPreset(), andsetPageSize()now recordmarginsDpiand triggersyncMarginGuideOverlay(). - Physical Paper Size Invariance:
- When changing paper size (e.g. A4 to A3) without changing DPI, the physical margin distance (e.g. 0.5 inches / 150px at 300 DPI) remains constant, naturally appearing proportionally smaller on the physically larger paper as expected.
- Publication Persistence & Legacy Auto-Repair:
- Saved
marginsDpiinio/file-io.jsandextensions/system-patches.js. - In
io/publisher-file-loader.js: restoredmarginsDpiand automatically repaired legacy publications saved at high DPI with unscaled 48px defaults back to the intended 0.5-inch physical margins (150px at 300 DPI).
12. Zoom-Invariant Drag and Control Handles (style.css, canvas/canvas.js, core/pages.js, extensions/system-patches.js)
- Root Cause:
- Control handles (
.resize-handle,.rotate-stick,.rotate-handle,.shape-edit-handle) and the.selected-overlayselection bounding box reside inside#paper(which is scaled bytransform: scale(zoom)). - In CSS, handles had fixed pixel dimensions (e.g. 15px by 15px for
.resize-handle, 40px height for.rotate-stick, 16px by 16px for.rotate-handle). - At standard 60% zoom (z = 0.60), handles rendered at comfortable screen sizes (~10px visual size, 24px stick length).
- On high-resolution canvases such as A4 at 300 DPI (2480px by 3508px), viewing the entire page requires zooming out to 15% - 25% zoom (z = 0.15 - 0.25).
- At z = 0.20, fixed 15px handles shrank on screen to 3px dots, the rotate stick shrank to 8px, and dashed selection outlines became invisible sub-pixel lines, making grabbing handles for resizing and rotation extremely difficult without zooming in.
- Dynamic CSS Variable Architecture:
- Defined CSS variables in
:rootand#paperfor handle geometry:--handle-size,--handle-half,--rotate-size,--rotate-half,--rotate-stick-len,--rotate-top,--handle-border-width,--handle-radius,--crop-handle-size,--crop-handle-half,--crop-border-width, and--shape-handle-size. - Implemented
window.syncHandleScaling(z)incanvas/canvas.jsto compute inverse-zoom values calibrated to the standard 60% page zoom appearance:- Resize handle optical screen size: constant 10px on screen (
10 / zoomin canvas units). - Rotate stick optical screen length: constant 24px on screen (
24 / zoomin canvas units). - Rotate circle optical diameter: constant 11px on screen (
11 / zoomin canvas units). - Border width: constant 1 physical screen pixel (
max(1, 1 / zoom)in canvas units). - Crop mode handles: constant 13.3px on screen (
13.33 / zoomin canvas units) with bright orange background and white border. - Shape edit handles: constant 8.5px on screen (
8.5 / zoomin canvas units).
- Resize handle optical screen size: constant 10px on screen (
- Seamless Interaction & Full Lifecycle Sync:
- Integrated
window.syncHandleScaling(z)intosetZoom(),renderPage(),renderSelectionOverlays(), and on startup. - Updated selection bounding box to
var(--handle-border-width, 1px) dashed var(--selection)so selection outlines remain crisp at 1 screen pixel at low zoom. - Mouse interaction deltas operate purely in canvas coordinates divided by zoom, maintaining 100% mathematical precision during resizing and rotation.
13. Automatic Content Scaling on Page Resize and DPI Change (layout/document.js, core/history.js)
- Proportional Element and Typography Scaling:
- When resizing an existing document to a higher DPI (e.g. from 96 DPI to 300 DPI) or a different page size, page elements (text boxes, typography, cropped images, vector shapes, tables, WordArt, guides, headers, footers) automatically scale proportionally to the new dimensions.
- Horizontally scales by
Sx = finalW / baseOldWand vertically bySy = finalH / oldH, using averageS = (Sx + Sy) / 2for typography and borders. - Explicit User Control in Resize Document Dialog:
- Added checkbox option:
[x] Scale page content automatically to match new size / DPI(enabled by default). - When checked, elements, text, and guides scale proportionally. When unchecked, canvas boundaries expand or contract while element coordinates and font sizes remain fixed.
- Comprehensive Element Coverage:
- Live DOM elements: scales
left,top,width,height, border radius, border width, anddata-original-font-size. - Typography: scales
.element-contentfont size, line-height, padding, margins, headingsH1toH6, and<font size="...">tags. - Tables: scales column widths, row heights, cell padding, and cell font sizes.
- Cropped images: scales image pixel offsets and crop bounds.
- Vector shapes: scales SVG container width/height, stroke widths, and shape stroke attributes.
- WordArt: invokes
syncWordArt()to re-render stretch-to-fit typography at the new scale. - Headers and Footers: scales header/footer font sizes and line heights.
- Guides: scales
.custom-guidehorizontal and vertical positions. - Multi-Page Synchronization & History Preservation:
- Scales serialized element data across all pages in
state.pages, updatingdpiand dimensions across the publication. - Viewport zoom compensation: smoothly adjusts zoom (
zoom * (baseOldW / finalW)) so the page's on-screen visual size remains steady without layout jumps. - Preserved
dpiinserializeCurrentPage()incore/history.js, ensuring undo and redo cleanly restore original dimensions and unscaled content.
14. Interactive Bottom-Bar DPI Status Badge & Visual Change Feedback (index.html, style.css, layout/document.js, core/pages.js)
- Unobtrusive Resting & Hover States in Bottom Bar:
- Added
#dpi-status-displayto the bottom status bar right next toPage 1 of 1(in#status-center-group). - Styled with
background: transparent; border: 1px solid transparent; opacity: 0.85; font-weight: 500;at rest so it blends in naturally without drawing unwanted attention. - On mouse hover, smoothly reveals a translucent highlight (
background: rgba(255, 255, 255, 0.18); border-color: rgba(255, 255, 255, 0.28); opacity: 1;), signaling that it is clickable. - Contextual resolution icon: displays
<i class="fas fa-print"></i>for medium and high-resolution print ($\ge 150$ DPI) and<i class="fas fa-desktop"></i>for screen/web resolution ($< 150$ DPI). - Quick-action trigger: clicking the badge directly opens the "Page Setup / Resize Document" dialog (
changeSize()), turning the label into an interactive shortcut. - Informative hover tooltip: reveals full resolution classification (e.g.
Document Resolution: 300 DPI (High-Resolution Print) (Click to Resize / Change DPI)). - On-Theme Teal & White Notification Toast:
- When DPI is changed via Size > Custom Size (
changeSize()), the user receives three synchronized visual indicators:- Golden Glow & Pulse Animation (
.highlight-pulse): The DPI badge in the status bar scales up and pulses with a bright golden-yellow glow (#ffeb3b, scale 1.15) for 2.8 seconds, then fades back to transparent. - Status Bar Confirmation Message:
#status-msgin the bottom bar displays a checkmark confirmation with exact dimensions:✓ DPI set to 300 (2480 × 3508 px) • Content scaled proportionallyfor 5 seconds before reverting toReady. - Themed Floating Notification Toast (
#dpi-change-toast): Styled with OpenPublisher's signature teal-and-white theme (linear-gradient(135deg, var(--ui-theme-dark, #005a55) 0%, var(--ui-theme-color, #007670) 100%), solid white badge with deep teal checkmark, pure white title, and mint-white typography) sliding up smoothly from the bottom center of the canvas and auto-dismissing after 4 seconds.
- Golden Glow & Pulse Animation (
- Dynamic Multi-Page & Lifecycle Integration:
- Integrated
window.updateDpiDisplay()intocore/pages.js(renderPage()),setPageSize()inlayout/document.js, template loading, and document initialization. - Full theme compatibility: high-contrast semi-transparent dark borders and hover states when bright themes are enabled.
✅ Checklist Completed
- [x]
core/units.js: Createdwindow.UnitConversionServicewithtoPixels,fromPixels,convert,formatValue,getPresetDimensions, anddetectFormat. - [x]
core/core.js: Initializeddpi: 96,unit: 'cm',rulerUnit: 'cm', andmarginsDpi: 96in globalstate. - [x]
core/pages.js: UpgradedrenderPagewith DPI-awaredetectFormat, scaled margins proportionally on DPI changes, updatedaddNewPageand sidebar thumbnail badge to use page DPI, overhauledhandleNewDocumentwith full setup modal defaulting tocmand resolution-aware margins, addedupdateMultiPageView,syncRulers,syncMarginGuideOverlay,syncHandleScaling, andupdateDpiDisplaytriggers. - [x]
layout/document.js: OverhauledchangeSize()with presets, units defaulting tocm, DPI, live preview, DPI-proportional margin scaling, and automatic proportional content scaling; addedwindow.notifyDpiChanged()andwindow.updateDpiDisplay(); removedstate.rulerUnitoverwrite; overhauledshowCustomMarginsModal(); addedsetMarginPresetInches(),updateMultiPageViewsync,syncRulerssync,syncMarginGuideOverlaysync, andrenderSelectionOverlaysrefresh. - [x]
core/history.js: PreserveddpiinserializeCurrentPage()to ensure clean undo and redo of document resizing and scaling. - [x]
canvas/canvas.js: Implemented DPI-awaregetMultiPageThreshold(), proportional multi-page wrapper scaling (gaps, borders, labels),zoomStepOut/zoomStepIn, DPI-scaledfitToPage()/fitToWidth(), DPI-aware physical canvas rulers defaulting tocmwith multi-unit support (cm,in,mm,px), dynamic handle scaling viawindow.syncHandleScaling(z), and DPI-aware fallback margins insyncMarginGuideOverlay. - [x]
canvas/interaction.js: Connected wheel and keyboard shortcuts to adaptivezoomStepOut()andzoomStepIn(). - [x]
style.css: Configured zoom-invariant handle variables on:rootand#paper, updated.resize-handle,.rh-*,.rotate-handle,.rotate-stick,.pub-element.cropping .resize-handle, and.shape-edit-handleto use dynamic CSS custom properties; added#dpi-status-display,.highlight-pulse,@keyframes dpiBadgePulse, and#dpi-change-toastfloating banner styles. - [x]
index.html: Addedcore/units.jsscript tag, updated zoom buttons to usezoomStepOut/In, updated margin presets, added#dpi-status-displayand#status-center-groupto bottom status bar, bumped all cachebusters to?v=5.1.4. - [x]
extensions/system-patches.js: Synchronized handle scaling on selection overlay renders, updated dashed bounding box to use--handle-border-width, and serializeddpi,unit,rulerUnit,margins, andmarginsDpiinsaveDocument. - [x]
ui/menus.js: Added ruler unit selection (cm,in,mm,px) with active checkmarks to ruler context menu. - [x]
extensions/print-engine.js: Replaced hardcoded/ 96with/ masterDpi, optimizedhtml2canvasprint scale for 300 DPI documents, eliminated blank page insertion via sub-pixel height adjustment (calc(height - 1px)) and strict page-break constraints, resolved rotated image styles, and added safety timeouts. - [x]
extensions/smart-images.js: AddeddropCoords = nullparameter, wrapped element insertion intry/catch, added synchronous completion handler. - [x]
extensions/ui-interactions.js: Upgraded template format detection withdetectFormat; added square format icon support. - [x]
ui/dashboard.js: UpdatedstartBlankto handle presets natively. - [x]
io/file-io.js&io/publisher-file-loader.js: Serialized and restoreddpi,unit,rulerUnit,margins, andmarginsDpi, with legacy high-DPI margin auto-repair. - [x]
elements/templates/templates.js: UpdatedgetPageSizeLabel, default DPI fallback, template cachebuster to?v=5.1.4, and resolution-aware margins inloadTemplate.
👥 Developers and Contributors
- rmellis: Lead Developer & Architect (Architecture & Core Systems)
- lucastucious: Core Contributor (Features & Enhancements)
- Tallulah95: UI Design & Element Positioning Choices
- Gemini 3.8: Mathematics & Playwright Verification
🎉 Version 5.1.4 - Open Publisher