aboutsummaryrefslogtreecommitdiff
path: root/pdf-as-web/src/main/java/at/gv/egiz
diff options
context:
space:
mode:
Diffstat (limited to 'pdf-as-web/src/main/java/at/gv/egiz')
-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);
}