aboutsummaryrefslogtreecommitdiff
path: root/pdf-as-web/src/main
diff options
context:
space:
mode:
authorChristian Maierhofer <cmaierhofer@iaik.tugraz.at>2014-02-24 13:38:15 +0100
committerChristian Maierhofer <cmaierhofer@iaik.tugraz.at>2014-02-25 09:48:38 +0100
commitc683ceb96e7c3e1d8fea6ebc90d61e0fb41fe9a4 (patch)
treea0cf48ce02e19594e941a4c45e8a28b45bf961b0 /pdf-as-web/src/main
parentab7a38ff2956d427b598704e9309912593ff1d87 (diff)
downloadpdf-as-4-c683ceb96e7c3e1d8fea6ebc90d61e0fb41fe9a4.tar.gz
pdf-as-4-c683ceb96e7c3e1d8fea6ebc90d61e0fb41fe9a4.tar.bz2
pdf-as-4-c683ceb96e7c3e1d8fea6ebc90d61e0fb41fe9a4.zip
added missing posF to parameter extractor
Diffstat (limited to 'pdf-as-web/src/main')
-rw-r--r--pdf-as-web/src/main/java/at/gv/egiz/pdfas/web/helper/PdfAsHelper.java16
-rw-r--r--pdf-as-web/src/main/java/at/gv/egiz/pdfas/web/helper/PdfAsParameterExtractor.java5
2 files changed, 20 insertions, 1 deletions
diff --git a/pdf-as-web/src/main/java/at/gv/egiz/pdfas/web/helper/PdfAsHelper.java b/pdf-as-web/src/main/java/at/gv/egiz/pdfas/web/helper/PdfAsHelper.java
index 450908a9..db933a6b 100644
--- a/pdf-as-web/src/main/java/at/gv/egiz/pdfas/web/helper/PdfAsHelper.java
+++ b/pdf-as-web/src/main/java/at/gv/egiz/pdfas/web/helper/PdfAsHelper.java
@@ -140,8 +140,9 @@ public class PdfAsHelper {
String posY = PdfAsParameterExtractor.getSigPosY(request);
String posW = PdfAsParameterExtractor.getSigPosW(request);
String posR = PdfAsParameterExtractor.getSigPosR(request);
+ String posF = PdfAsParameterExtractor.getSigPosF(request);
- if (posP == null && posW == null && posX == null && posY == null && posR == null) {
+ if (posP == null && posW == null && posX == null && posY == null && posR == null && posF == null) {
return null;
}
@@ -213,6 +214,19 @@ public class PdfAsHelper {
} else {
sb.append("r:0;");
}
+
+ if (posF != null) {
+ try {
+ Float.parseFloat(posF);
+ } catch (NumberFormatException e) {
+ throw new PdfAsWebException(
+ PdfAsParameterExtractor.PARAM_SIG_POS_F
+ + " has invalid value!", e);
+ }
+ sb.append("f:" + posF.trim() + ";");
+ } else {
+ sb.append("f:0;");
+ }
return sb.toString();
}
diff --git a/pdf-as-web/src/main/java/at/gv/egiz/pdfas/web/helper/PdfAsParameterExtractor.java b/pdf-as-web/src/main/java/at/gv/egiz/pdfas/web/helper/PdfAsParameterExtractor.java
index dbdb3716..532bfadb 100644
--- a/pdf-as-web/src/main/java/at/gv/egiz/pdfas/web/helper/PdfAsParameterExtractor.java
+++ b/pdf-as-web/src/main/java/at/gv/egiz/pdfas/web/helper/PdfAsParameterExtractor.java
@@ -42,6 +42,7 @@ public class PdfAsParameterExtractor {
public static final String PARAM_SIG_POS_X = "sig-pos-x";
public static final String PARAM_SIG_POS_W = "sig-pos-w";
public static final String PARAM_SIG_POS_R = "sig-pos-r";
+ public static final String PARAM_SIG_POS_F = "sig-pos-f";
public static final String PARAM_SIG_IDX = "sig-idx";
public static String getConnector(HttpServletRequest request) {
@@ -100,6 +101,10 @@ public class PdfAsParameterExtractor {
return (String)request.getAttribute(PARAM_SIG_POS_R);
}
+ public static String getSigPosF(HttpServletRequest request) {
+ return (String)request.getAttribute(PARAM_SIG_POS_F);
+ }
+
public static String getSigIdx(HttpServletRequest request) {
return (String)request.getAttribute(PARAM_SIG_IDX);
}