Skip to content

Commit

Permalink
Fix the maximum size of a word page and set the size to max value 22in (
Browse files Browse the repository at this point in the history
  • Loading branch information
speckyspooky authored Aug 23, 2024
1 parent 154104d commit 8b70080
Showing 1 changed file with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 8b70080

Please sign in to comment.