aboutsummaryrefslogtreecommitdiff
path: root/pdf-as-common/src/main/java/at/gv/egiz
diff options
context:
space:
mode:
Diffstat (limited to 'pdf-as-common/src/main/java/at/gv/egiz')
-rw-r--r--pdf-as-common/src/main/java/at/gv/egiz/pdfas/common/settings/IProfileConstants.java1
-rw-r--r--pdf-as-common/src/main/java/at/gv/egiz/pdfas/common/settings/SignatureProfileSettings.java10
-rw-r--r--pdf-as-common/src/main/java/at/gv/egiz/pdfas/common/utils/OgnlUtils.java3
-rw-r--r--pdf-as-common/src/main/java/at/gv/egiz/pdfas/common/utils/StringUtils.java8
4 files changed, 18 insertions, 4 deletions
diff --git a/pdf-as-common/src/main/java/at/gv/egiz/pdfas/common/settings/IProfileConstants.java b/pdf-as-common/src/main/java/at/gv/egiz/pdfas/common/settings/IProfileConstants.java
index df1f4682..e1fcb9d0 100644
--- a/pdf-as-common/src/main/java/at/gv/egiz/pdfas/common/settings/IProfileConstants.java
+++ b/pdf-as-common/src/main/java/at/gv/egiz/pdfas/common/settings/IProfileConstants.java
@@ -94,5 +94,6 @@ public interface IProfileConstants {
public final static String SIG_PDFA1B_VALID = "SIG_PDFA1B_VALID";
public final static String SIG_PDFA_VALID = "SIG_PDFA_VALID";
public final static String SIG_PDFUA_FORCE = "SIG_PDFUA_FORCE";
+ public final static String LATIN1_ENCODING = "latin1_encoding";
}
diff --git a/pdf-as-common/src/main/java/at/gv/egiz/pdfas/common/settings/SignatureProfileSettings.java b/pdf-as-common/src/main/java/at/gv/egiz/pdfas/common/settings/SignatureProfileSettings.java
index bb6cca83..a151f12e 100644
--- a/pdf-as-common/src/main/java/at/gv/egiz/pdfas/common/settings/SignatureProfileSettings.java
+++ b/pdf-as-common/src/main/java/at/gv/egiz/pdfas/common/settings/SignatureProfileSettings.java
@@ -238,6 +238,16 @@ public class SignatureProfileSettings implements IProfileConstants {
return false;
}
+
+ public boolean isLatin1Encoding() {
+ SignatureProfileEntry entry = profileInformations.get(LATIN1_ENCODING);
+ if (entry != null) {
+ String value = entry.getCaption();
+ return "true".equals(value);
+ }
+ return false;
+ }
+
public boolean isPDFA3() {
if(this.pdfAVersion != null) {
return "3".equals(this.pdfAVersion);
diff --git a/pdf-as-common/src/main/java/at/gv/egiz/pdfas/common/utils/OgnlUtils.java b/pdf-as-common/src/main/java/at/gv/egiz/pdfas/common/utils/OgnlUtils.java
index d5bae58e..50a34c57 100644
--- a/pdf-as-common/src/main/java/at/gv/egiz/pdfas/common/utils/OgnlUtils.java
+++ b/pdf-as-common/src/main/java/at/gv/egiz/pdfas/common/utils/OgnlUtils.java
@@ -30,6 +30,8 @@ import ognl.OgnlException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
+import java.nio.charset.Charset;
+
/**
* Created with IntelliJ IDEA.
* User: afitzek
@@ -52,6 +54,7 @@ public class OgnlUtils {
valueString = valueString.substring(0, valueString.length() - 1);
}
return valueString;
+
} catch (OgnlException e) {
logger.warn("OGNL resolver failed!", e);
}
diff --git a/pdf-as-common/src/main/java/at/gv/egiz/pdfas/common/utils/StringUtils.java b/pdf-as-common/src/main/java/at/gv/egiz/pdfas/common/utils/StringUtils.java
index dbea3c70..7156a97b 100644
--- a/pdf-as-common/src/main/java/at/gv/egiz/pdfas/common/utils/StringUtils.java
+++ b/pdf-as-common/src/main/java/at/gv/egiz/pdfas/common/utils/StringUtils.java
@@ -23,13 +23,13 @@
******************************************************************************/
package at.gv.egiz.pdfas.common.utils;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
import java.io.UnsupportedEncodingException;
import java.net.URLEncoder;
import java.util.Formatter;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
/**
* Created with IntelliJ IDEA. User: afitzek Date: 8/28/13 Time: 12:42 PM To
* change this template use File | Settings | File Templates.
@@ -62,7 +62,7 @@ public class StringUtils {
public static String convertStringToPDFFormat(String value)
throws UnsupportedEncodingException {
-
+
if(value == null) {
logger.warn("Trying to convert null string!");
return value;