diff options
author | Andreas Fitzek <andreas.fitzek@iaik.tugraz.at> | 2014-02-18 09:27:30 +0100 |
---|---|---|
committer | Andreas Fitzek <andreas.fitzek@iaik.tugraz.at> | 2014-02-18 09:29:29 +0100 |
commit | c2accdef2e43307954718ad5683c881155588365 (patch) | |
tree | 87ec80a1df8d7b9f7293da1bf6a63841188c0542 /pdf-as-web/src/main/java/at/gv/egiz/pdfas/web | |
parent | 3d7d82dae1642a01dac69cf550ccdcb6b571357c (diff) | |
download | pdf-as-4-c2accdef2e43307954718ad5683c881155588365.tar.gz pdf-as-4-c2accdef2e43307954718ad5683c881155588365.tar.bz2 pdf-as-4-c2accdef2e43307954718ad5683c881155588365.zip |
Added rotation parameter to PDF-AS Web
Signed-off-by: Andreas Fitzek <andreas.fitzek@iaik.tugraz.at>
Diffstat (limited to 'pdf-as-web/src/main/java/at/gv/egiz/pdfas/web')
-rw-r--r-- | pdf-as-web/src/main/java/at/gv/egiz/pdfas/web/helper/PdfAsHelper.java | 14 | ||||
-rw-r--r-- | pdf-as-web/src/main/java/at/gv/egiz/pdfas/web/helper/PdfAsParameterExtractor.java | 5 |
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); } |