From 8b7008011e257e5c90506c4a3a43954e05990c8e Mon Sep 17 00:00:00 2001 From: Thomas Gutmann <41593722+speckyspooky@users.noreply.github.com> Date: Fri, 23 Aug 2024 15:54:22 +0200 Subject: [PATCH] Fix the maximum size of a word page and set the size to max value 22in (#1875) --- .../birt/report/engine/emitter/wpml/AbstractEmitterImpl.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/engine/org.eclipse.birt.report.engine.emitter.wpml/src/org/eclipse/birt/report/engine/emitter/wpml/AbstractEmitterImpl.java b/engine/org.eclipse.birt.report.engine.emitter.wpml/src/org/eclipse/birt/report/engine/emitter/wpml/AbstractEmitterImpl.java index 60a4a0a3a3..73612e0b6b 100644 --- a/engine/org.eclipse.birt.report.engine.emitter.wpml/src/org/eclipse/birt/report/engine/emitter/wpml/AbstractEmitterImpl.java +++ b/engine/org.eclipse.birt.report.engine.emitter.wpml/src/org/eclipse/birt/report/engine/emitter/wpml/AbstractEmitterImpl.java @@ -442,7 +442,12 @@ public void computePageProperties(IPageContent page) { // Default height/width is the width/height of A4, the width 595.275pt * // PT_TWIPS, the height is 841.889 * PT_TWIPS pageWidth = WordUtil.convertTo(page.getPageWidth(), 11906, reportDpi); + // MS Word limitation, maximum width: 22in + pageWidth = Math.min(pageWidth, WordUtil.MAX_ELEMENT_WIDTH_INCH_TWIPS); + pageHeight = WordUtil.convertTo(page.getPageHeight(), 16838, reportDpi); + // MS Word limitation, maximum height: 22in + pageHeight = Math.min(pageHeight, WordUtil.MAX_ELEMENT_WIDTH_INCH_TWIPS); footerHeight = WordUtil.convertTo(page.getFooterHeight(), 0, reportDpi); headerHeight = WordUtil.convertTo(page.getHeaderHeight(), 0, reportDpi);