pdfbox-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Tilman Hausherr <THaush...@t-online.de>
Subject Re: Adjust signature field for rotated pages
Date Wed, 24 Oct 2018 19:57:16 GMT
Done in

https://issues.apache.org/jira/browse/PDFBOX-4359

There will be a snapshot in a few hours, hopfully (build server unstable)

Tilman



Am 24.10.2018 um 19:20 schrieb Tilman Hausherr:
> Please extend the PDVisibleSignDesigner class and implement this 
> method. I'll commit this later (don't have much time right now).
>
>
>     public PDVisibleSignDesigner adjustForRotation()
>     {
>         switch (rotation)
>         {
>             case 90:
>                 // https://stackoverflow.com/a/34359956/535646
>                 float temp = yAxis;
>                 yAxis = pageHeight - xAxis - imageWidth;
>                 xAxis = temp;
>
>                 affineTransform = new AffineTransform(
>                         0, imageHeight / imageWidth, -imageWidth
/ 
> imageHeight, 0, imageWidth, 0);
>
>                 temp = imageHeight;
>                 imageHeight = imageWidth;
>                 imageWidth = temp;
>                 break;
>
>             case 180:
>                 float newX = pageWidth - xAxis - imageWidth;
>                 float newY = pageHeight - yAxis - imageHeight;
>                 xAxis = newX;
>                 yAxis = newY;
>
>                 affineTransform = new AffineTransform(-1, 0, 0, -1, 
> imageWidth, imageHeight);
>                 break;
>
>             case 270:
>                 temp = xAxis;
>                 xAxis = pageWidth - yAxis - imageHeight;
>                 yAxis = temp;
>
>                 affineTransform = new AffineTransform(
>                         0, -imageHeight / imageWidth, imageWidth
/ 
> imageHeight, 0, 0, imageHeight);
>
>                 temp = imageHeight;
>                 imageHeight = imageWidth;
>                 imageWidth = temp;
>                 break;
>
>             case 0:
>             default:
>                 break;
>         }
>         return this;
>     }
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@pdfbox.apache.org
> For additional commands, e-mail: users-help@pdfbox.apache.org
>


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@pdfbox.apache.org
For additional commands, e-mail: users-help@pdfbox.apache.org


Mime
View raw message