You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pdfbox.apache.org by ti...@apache.org on 2026/04/16 14:27:04 UTC
svn commit: r1933112 - pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/printing
Author: tilman
Date: Thu Apr 16 14:27:03 2026
New Revision: 1933112
Log:
PDFBOX-5660: simplify code, as suggested by copilot
Modified:
pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/printing/PDFPageable.java
Modified: pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/printing/PDFPageable.java
==============================================================================
--- pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/printing/PDFPageable.java Thu Apr 16 14:27:00 2026 (r1933111)
+++ pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/printing/PDFPageable.java Thu Apr 16 14:27:03 2026 (r1933112)
@@ -188,12 +188,11 @@ public final class PDFPageable extends B
//
// As a workaround, we normalise all Page(s) to be portrait, then flag them as landscape in
// the PageFormat.
- Paper paper;
+ Paper paper = new Paper();
boolean isLandscape;
if (mediaBox.getWidth() > mediaBox.getHeight())
{
// rotate
- paper = new Paper();
paper.setSize(mediaBox.getHeight(), mediaBox.getWidth());
paper.setImageableArea(cropBox.getLowerLeftY(), cropBox.getLowerLeftX(),
cropBox.getHeight(), cropBox.getWidth());
@@ -201,7 +200,6 @@ public final class PDFPageable extends B
}
else
{
- paper = new Paper();
paper.setSize(mediaBox.getWidth(), mediaBox.getHeight());
paper.setImageableArea(cropBox.getLowerLeftX(), cropBox.getLowerLeftY(),
cropBox.getWidth(), cropBox.getHeight());