tsgrp / HPI

OpenContent Management Suite (OCMS)
http://www.tsgrp.com/products
17 stars 5 forks source link

OpenOverlay: Failure to Apply Overlay to A3 Sized Documents (Portrait or Landscape) #2405

Closed mwojno-tsg closed 3 years ago

mwojno-tsg commented 3 years ago

Overview

Reproduce

Proposed Solution

if((pageWidth == letter.getHeight()) && (pageHeight == letter.getWidth())) {return "letter";}
else if((pageWidth == legal.getHeight()) && (pageHeight == legal.getWidth())) {return "legal";}
else if((pageWidth == tabloid.getHeight()) && (pageHeight == tabloid.getWidth())) {return "tabloid";}
else if((pageWidth == executive.getHeight()) && (pageHeight == executive.getWidth())) {return "executive";}
else if((**Math.ceil**(pageWidth) == Math.round(a3.getHeight())) && (**Math.ceil**(pageHeight) == Math.round(a3.getWidth()))) {return "a3";}
else if((Math.round(pageWidth) == Math.round(a4.getHeight())) && (Math.round(pageHeight) == Math.round(a4.getWidth()))) {return "a4";}
mwojno-tsg commented 3 years ago

Remember to take a look and update documentation, if necessary.

mwojno-tsg commented 3 years ago

This issue was closed following the solution described above. For a3 and a4, I changed round to ceil because of a rounding issue that was skipping the a3 page size.

OpenOverlay commit: 247 OC commit: 26809

CR: rsaladrigas, ballen