Author: tilman
Date: Tue Aug 12 18:23:09 2025
New Revision: 1927771
Log:
PDFBOX-6049: revert change that isn't meant to be in 3.0
Modified:
pdfbox/branches/3.0/pdfbox/src/main/java/org/apache/pdfbox/multipdf/Overlay.java
Modified:
pdfbox/branches/3.0/pdfbox/src/main/java/org/apache/pdfbox/multipdf/Overlay.java
==============================================================================
---
pdfbox/branches/3.0/pdfbox/src/main/java/org/apache/pdfbox/multipdf/Overlay.java
Tue Aug 12 17:56:17 2025 (r1927770)
+++
pdfbox/branches/3.0/pdfbox/src/main/java/org/apache/pdfbox/multipdf/Overlay.java
Tue Aug 12 18:23:09 2025 (r1927771)
@@ -599,9 +599,9 @@ public class Overlay implements Closeabl
/**
* Calculate the transform to be used when positioning the overlay. The
default implementation
- * centers on the destination, and this is calculated from the lower left
of the media box of
- * the destination (this has been changed from 3.0 and 2.0, see
PDFBOX-6048 for details).
- * Override this method to do your own, e.g. move to a corner, rotate, or
zoom.
+ * centers on the destination and assumes (0,0) to be the lower left (This
will be changed in
+ * 4.0, see PDFBOX-6048 why). Override this method to do your own, e.g.
move to a corner,
+ * rotate, or zoom.
*
* @param page The page that will get the overlay.
* @param overlayMediaBox The overlay media box.
@@ -611,8 +611,8 @@ public class Overlay implements Closeabl
{
AffineTransform at = new AffineTransform();
PDRectangle pageMediaBox = page.getMediaBox();
- float hShift = pageMediaBox.getLowerLeftX() + (pageMediaBox.getWidth()
- overlayMediaBox.getWidth()) / 2.0f;
- float vShift = pageMediaBox.getLowerLeftY() +
(pageMediaBox.getHeight() - overlayMediaBox.getHeight()) / 2.0f;
+ float hShift = (pageMediaBox.getWidth() - overlayMediaBox.getWidth())
/ 2.0f;
+ float vShift = (pageMediaBox.getHeight() -
overlayMediaBox.getHeight()) / 2.0f;
if (LOG.isDebugEnabled())
{
LOG.debug("Overlay position: (" + hShift + "," + vShift + ")");