Skip to content

Commit

Permalink
Rounding dimensions
Browse files Browse the repository at this point in the history
  • Loading branch information
litvinovg committed Mar 13, 2019
1 parent 39212ff commit 14bf833
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions src/main/java/ru/ras/iph/impose/ImposeonA3.java
Original file line number Diff line number Diff line change
Expand Up @@ -61,10 +61,17 @@ public static void main(String[] args) throws IOException, DocumentException {
for (int i = 1; i <= reader.getNumberOfPages(); i = i + 8) {
page = writer.getImportedPage(reader, i);


if ((page.getWidth() <= PageSize.A5.getWidth() && page.getHeight() <= PageSize.A5.getHeight())||(page.getHeight() <= PageSize.A5.getWidth() && page.getWidth() <= PageSize.A5.getHeight())) {


int curHeight = Math.round(page.getHeight());
int curWidth = Math.round(page.getWidth());
int a5Height = Math.round(PageSize.A5.getHeight());
int a5Width = Math.round(PageSize.A5.getWidth());
System.out.println("Ширина страницы " + curWidth);
System.out.println("Высота страницы " + curHeight);
System.out.println("Ширина страницы А5 " + a5Width);
System.out.println("Высота страницы A5 " + a5Height);

if ((curWidth <= a5Width && curHeight <= a5Height)||(curHeight <= a5Width && curWidth <= a5Height)) {

float deltaWLayout = 1f;
float deltaHLayout = 1f;
float deltaW = 1f;
Expand Down

0 comments on commit 14bf833

Please sign in to comment.