Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix the maximum size of a word page and set the size to max value 22in (#1874) #1875

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading