What should really be done is to add something like this near the end of
calculateAffineTransform():
switch (page.getRotation())
{
case 90:
at.rotate(Math.toRadians(90), hShift, vShift);
break;
case 180:
at.rotate(Math.toRadians(180), hShift, vShift);
break;
case 270:
// at.translate(0, pageMediaBox.getWidth() -
overlayMediaBox.getWidth());
// at.rotate(Math.toRadians(270));
at.rotate(Math.toRadians(270), hShift, vShift);
break;
default:
break;
}
However it doesn't appear at the proper place. The commented code shows
it a bit better but still not correct.
An alternative would be that I change the Overlay code so that
automatically adds a rotation entry to the overlay and thus creates 4
different ones depending on the rotation of the source document page.
Tilman
Am 06.08.2025 um 22:50 schrieb Brent:
Thanks Tilman,
Yes, we have now confirmed that some pages are rotated 180 degrees.
These pages when viewed in the reader look correct, but within the PDF they
are rotated.
We could create a rotated overlay and just switch which overlay we use
depending on the rotation of the page.
But perhaps you have a more elegant way that we might approach this.
Thank you for your help, Brent
On Wed, Aug 6, 2025 at 2:43 PM Tilman Hausherr <thaush...@t-online.de>
wrote:
Hi,
Maybe the document has rotated pages, I'm not sure if we support this
properly.
I'm going to sleep, but feel free to test with this document:
https://issues.apache.org/jira/secure/attachment/12847414/gs-bugzilla690022-reduced-rotations.pdf
Also open this document with PDFDebugger, you'll see the rotation value on
the left:
Tilman
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@pdfbox.apache.org
For additional commands, e-mail: users-h...@pdfbox.apache.org