Author: tilman
Date: Tue Aug 12 09:32:33 2025
New Revision: 1927765
Log:
PDFBOX-6049: use quadrantrotate, change int to short
Modified:
pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/multipdf/Overlay.java
Modified:
pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/multipdf/Overlay.java
==============================================================================
---
pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/multipdf/Overlay.java
Tue Aug 12 09:31:24 2025 (r1927764)
+++
pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/multipdf/Overlay.java
Tue Aug 12 09:32:33 2025 (r1927765)
@@ -283,9 +283,9 @@ public class Overlay implements Closeabl
private final PDRectangle overlayMediaBox;
private final COSStream overlayCOSStream;
private final COSDictionary overlayResources;
- private final short overlayRotation;
+ private final int overlayRotation;
- private LayoutPage(PDRectangle mediaBox, COSStream contentStream,
COSDictionary resources, short rotation)
+ private LayoutPage(PDRectangle mediaBox, COSStream contentStream,
COSDictionary resources, int rotation)
{
overlayMediaBox = mediaBox;
overlayCOSStream = contentStream;
@@ -321,7 +321,7 @@ public class Overlay implements Closeabl
resources = new PDResources();
}
return new LayoutPage(page.getMediaBox(),
createCombinedContentStream(contents),
- resources.getCOSObject(), (short) page.getRotation());
+ resources.getCOSObject(), page.getRotation());
}
private Map<Integer,LayoutPage> createPageOverlayLayoutPageMap(PDDocument
doc) throws IOException
@@ -505,15 +505,15 @@ public class Overlay implements Closeabl
{
case 90:
at.translate(0, layoutPage.overlayMediaBox.getWidth());
- at.rotate(Math.toRadians(-90));
+ at.quadrantRotate(3); // 270
break;
case 180:
at.translate(layoutPage.overlayMediaBox.getWidth(),
layoutPage.overlayMediaBox.getHeight());
- at.rotate(Math.toRadians(-180));
+ at.quadrantRotate(2); // 180
break;
case 270:
at.translate(layoutPage.overlayMediaBox.getHeight(), 0);
- at.rotate(Math.toRadians(-270));
+ at.quadrantRotate(1); // 90
break;
default:
break;