Skip to content

Commit

Permalink
PDFBOX-5837: add noCenter option
Browse files Browse the repository at this point in the history
git-svn-id: https://svn.apache.org/repos/asf/pdfbox/trunk@1918292 13f79535-47bb-0310-9956-ffa450edef68
  • Loading branch information
THausherr committed Jun 13, 2024
1 parent be97770 commit 6f8b8a1
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions tools/src/main/java/org/apache/pdfbox/tools/PrintPDF.java
Original file line number Diff line number Diff line change
Expand Up @@ -101,10 +101,13 @@ Sides toSides()
@Option(names = "-border", description = "print with border.")
private boolean border;

@Option(names = "-dpi", description = "render into intermediate image with specific dpi and then print")
@Option(names = "-dpi", description = "render into intermediate image with specific dpi and then print.")
private int dpi;

@Option(names = "-noColorOpt", description = "disable color optimizations (useful when printing barcodes)")
@Option(names = "-noCenter", description = "align top-left (default: center on page).")
private boolean noCenter = false;

@Option(names = "-noColorOpt", description = "disable color optimizations (useful when printing barcodes).")
private boolean noColorOpt;

@Option(names = {"-i", "--input"}, description = "the PDF files to print.", required = true)
Expand Down Expand Up @@ -219,7 +222,7 @@ public Integer call()
}
}

PDFPageable pageable = new PDFPageable(document, orientation, border, dpi);
PDFPageable pageable = new PDFPageable(document, orientation, border, dpi, !noCenter);
pageable.setRenderingHints(renderingHints);
printJob.setPageable(pageable);

Expand Down

0 comments on commit 6f8b8a1

Please sign in to comment.