aboutsummaryrefslogtreecommitdiff
path: root/pdf-as-web/src/main/java
diff options
context:
space:
mode:
Diffstat (limited to 'pdf-as-web/src/main/java')
-rw-r--r--pdf-as-web/src/main/java/at/gv/egiz/pdfas/web/helper/PdfAsHelper.java14
-rw-r--r--pdf-as-web/src/main/java/at/gv/egiz/pdfas/web/helper/PdfAsParameterExtractor.java5
2 files changed, 19 insertions, 0 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 607c6228..9f35fbc6 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
@@ -116,6 +116,7 @@ public class PdfAsHelper {
String posX = PdfAsParameterExtractor.getSigPosX(request);
String posY = PdfAsParameterExtractor.getSigPosY(request);
String posW = PdfAsParameterExtractor.getSigPosW(request);
+ String posR = PdfAsParameterExtractor.getSigPosR(request);
if (posP == null && posW == null && posX == null && posY == null) {
return null;
@@ -176,6 +177,19 @@ public class PdfAsHelper {
} else {
sb.append("p:auto;");
}
+
+ if (posR != null) {
+ try {
+ Float.parseFloat(posR);
+ } catch (NumberFormatException e) {
+ throw new PdfAsWebException(
+ PdfAsParameterExtractor.PARAM_SIG_POS_R
+ + " has invalid value!", e);
+ }
+ sb.append("r:" + posR.trim() + ";");
+ } else {
+ sb.append("r: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 b20a6656..500266be 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
@@ -18,6 +18,7 @@ public class PdfAsParameterExtractor {
public static final String PARAM_SIG_POS_Y = "sig-pos-y";
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_IDX = "sig-idx";
public static String getConnector(HttpServletRequest request) {
@@ -72,6 +73,10 @@ public class PdfAsParameterExtractor {
return (String)request.getAttribute(PARAM_SIG_POS_W);
}
+ public static String getSigPosR(HttpServletRequest request) {
+ return (String)request.getAttribute(PARAM_SIG_POS_R);
+ }
+
public static String getSigIdx(HttpServletRequest request) {
return (String)request.getAttribute(PARAM_SIG_IDX);
}