aboutsummaryrefslogtreecommitdiff
path: root/pdf-as-lib/src/main/java/at/knowcenter/wag/egov
diff options
context:
space:
mode:
authorAndreas Fitzek <andreas.fitzek@iaik.tugraz.at>2014-08-26 16:05:20 +0200
committerAndreas Fitzek <andreas.fitzek@iaik.tugraz.at>2014-08-26 16:05:20 +0200
commit2ec24a6433b77cf421e602450dafff2b371b8afc (patch)
treedd944a896e711a369b21f6d6c2e255d5572e70a4 /pdf-as-lib/src/main/java/at/knowcenter/wag/egov
parentaceea898eb8f9b4d7b634bfc6f97e682f5c0a9c1 (diff)
downloadpdf-as-4-2ec24a6433b77cf421e602450dafff2b371b8afc.tar.gz
pdf-as-4-2ec24a6433b77cf421e602450dafff2b371b8afc.tar.bz2
pdf-as-4-2ec24a6433b77cf421e602450dafff2b371b8afc.zip
Improved Positioning input validation for signature rotation
Diffstat (limited to 'pdf-as-lib/src/main/java/at/knowcenter/wag/egov')
-rw-r--r--pdf-as-lib/src/main/java/at/knowcenter/wag/egov/egiz/pdf/TablePos.java11
1 files changed, 6 insertions, 5 deletions
diff --git a/pdf-as-lib/src/main/java/at/knowcenter/wag/egov/egiz/pdf/TablePos.java b/pdf-as-lib/src/main/java/at/knowcenter/wag/egov/egiz/pdf/TablePos.java
index 420a8f0a..e49b481e 100644
--- a/pdf-as-lib/src/main/java/at/knowcenter/wag/egov/egiz/pdf/TablePos.java
+++ b/pdf-as-lib/src/main/java/at/knowcenter/wag/egov/egiz/pdf/TablePos.java
@@ -253,11 +253,12 @@ public class TablePos implements Serializable
}
case 'r': {
float flval=Float.parseFloat(commandval);
- // TODO: check rotation to be only multiples of 90 degrees
- if (flval<0)
- {
- throw new PdfAsException("Pos string (=" + pos_string + ") is invalid.");
- }
+ // reduce to 0 - 360 degrees
+ flval = flval % 360;
+ // we only support rotation in 90 degree steps
+ if(flval % 90 != 0) {
+ throw new PdfAsException("Pos string (=" + pos_string + ") is invalid. Rotation is only allowed to be a multiple of 90.");
+ }
this.rotation = flval;
break;
}