diff options
author | tknall <tknall@7b5415b0-85f9-ee4d-85bd-d5d0c3b42d1c> | 2011-01-27 18:04:14 +0000 |
---|---|---|
committer | tknall <tknall@7b5415b0-85f9-ee4d-85bd-d5d0c3b42d1c> | 2011-01-27 18:04:14 +0000 |
commit | 2a919c58dae02da975b1a2c0ea485f4338305b9d (patch) | |
tree | c20d22f003557d6e1f5037766c8830f29a11f685 /src/main/java/at/gv/egiz/pdfas/placeholder | |
parent | 89a2096dfb6c45902c6cd1970fb9b0846474ffe7 (diff) | |
download | pdf-as-3-2a919c58dae02da975b1a2c0ea485f4338305b9d.tar.gz pdf-as-3-2a919c58dae02da975b1a2c0ea485f4338305b9d.tar.bz2 pdf-as-3-2a919c58dae02da975b1a2c0ea485f4338305b9d.zip |
- more logging
- commandline: signature mode (textual, binary) set optional (setting default mode, equivalent to api usage)
- documentation updated
git-svn-id: https://joinup.ec.europa.eu/svn/pdf-as/trunk@736 7b5415b0-85f9-ee4d-85bd-d5d0c3b42d1c
Diffstat (limited to 'src/main/java/at/gv/egiz/pdfas/placeholder')
-rw-r--r-- | src/main/java/at/gv/egiz/pdfas/placeholder/SignaturePlaceholderExtractor.java | 44 |
1 files changed, 24 insertions, 20 deletions
diff --git a/src/main/java/at/gv/egiz/pdfas/placeholder/SignaturePlaceholderExtractor.java b/src/main/java/at/gv/egiz/pdfas/placeholder/SignaturePlaceholderExtractor.java index c9d5cd7..b33c7f3 100644 --- a/src/main/java/at/gv/egiz/pdfas/placeholder/SignaturePlaceholderExtractor.java +++ b/src/main/java/at/gv/egiz/pdfas/placeholder/SignaturePlaceholderExtractor.java @@ -266,30 +266,34 @@ public class SignaturePlaceholderExtractor extends PDFStreamEngine { String type = null;
String sigKey = null;
String id = null;
- if (text != null && text.startsWith("PDF-AS-POS")) {
- String[] data = text.split(";");
- if (data.length > 1) {
- for (int i = 1; i < data.length; i++) {
- String kvPair = data[i];
- String[] kv = kvPair.split("=");
- if (kv.length != 2) {
- log.debug("invalid parameter in placeholder data: " + kvPair);
- } else {
- if (kv[0].equalsIgnoreCase(SignaturePlaceholderData.ID_KEY)) {
- id = kv[1];
- } else if (kv[0].equalsIgnoreCase(SignaturePlaceholderData.PROFILE_KEY)) {
- profile = kv[1];
- } else if (kv[0]
- .equalsIgnoreCase(SignaturePlaceholderData.SIG_KEY_KEY)) {
- sigKey = kv[1];
- } else if (kv[0]
- .equalsIgnoreCase(SignaturePlaceholderData.TYPE_KEY)) {
- type = kv[1];
+ if (text != null) {
+ if (text.startsWith(Constants.QR_PLACEHOLDER_IDENTIFIER)) {
+ String[] data = text.split(";");
+ if (data.length > 1) {
+ for (int i = 1; i < data.length; i++) {
+ String kvPair = data[i];
+ String[] kv = kvPair.split("=");
+ if (kv.length != 2) {
+ log.debug("Invalid parameter in placeholder data: " + kvPair);
+ } else {
+ if (kv[0].equalsIgnoreCase(SignaturePlaceholderData.ID_KEY)) {
+ id = kv[1];
+ } else if (kv[0].equalsIgnoreCase(SignaturePlaceholderData.PROFILE_KEY)) {
+ profile = kv[1];
+ } else if (kv[0]
+ .equalsIgnoreCase(SignaturePlaceholderData.SIG_KEY_KEY)) {
+ sigKey = kv[1];
+ } else if (kv[0]
+ .equalsIgnoreCase(SignaturePlaceholderData.TYPE_KEY)) {
+ type = kv[1];
+ }
}
}
}
+ return new SignaturePlaceholderData(profile, type, sigKey, id);
+ } else {
+ log.warn("QR-Code found but does not start with \"" + Constants.QR_PLACEHOLDER_IDENTIFIER + "\". Ignoring QR placeholder.");
}
- return new SignaturePlaceholderData(profile, type, sigKey, id);
}
} catch (ReaderException re) {
if (log.isDebugEnabled()) {
|