diff options
author | Jakob Heher <jakob.heher@iaik.tugraz.at> | 2022-11-18 11:42:48 +0100 |
---|---|---|
committer | Jakob Heher <jakob.heher@iaik.tugraz.at> | 2022-11-18 11:42:48 +0100 |
commit | eb7766f3265b2732ebd8cc4764fcdec213d68b61 (patch) | |
tree | 6e82dda13fa3c66e20d5eea6b917e0d2053c0d62 /pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/SignaturePanel.java | |
parent | 76f19799233d85bd863c9a227db73bb280f35c18 (diff) | |
download | pdf-over-eb7766f3265b2732ebd8cc4764fcdec213d68b61.tar.gz pdf-over-eb7766f3265b2732ebd8cc4764fcdec213d68b61.tar.bz2 pdf-over-eb7766f3265b2732ebd8cc4764fcdec213d68b61.zip |
respect PDF rotation
Diffstat (limited to 'pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/SignaturePanel.java')
-rw-r--r-- | pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/SignaturePanel.java | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/SignaturePanel.java b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/SignaturePanel.java index 250daf7d..afc6b0db 100644 --- a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/SignaturePanel.java +++ b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/SignaturePanel.java @@ -263,10 +263,11 @@ public class SignaturePanel extends JPanel { this.currentImage = null;
return;
}
-
+
+ boolean isRotated = ((currentPage.getRotation()%180) == 90);
PDRectangle actualPageSize = currentPage.getBBox();
- this.pageWidth = actualPageSize.getWidth();
- this.pageHeight = actualPageSize.getHeight();
+ this.pageWidth = isRotated ? actualPageSize.getHeight() : actualPageSize.getWidth();
+ this.pageHeight = isRotated ? actualPageSize.getWidth() : actualPageSize.getHeight();
this.pageToImageScale = getToolkit().getScreenSize().height / this.pageHeight;
// get the new image
|