From 65eb7054679d63a4f519bd31eb37805666e6fef8 Mon Sep 17 00:00:00 2001 From: Andreas Fitzek Date: Mon, 12 Dec 2016 07:50:25 +0100 Subject: added PDF/A-3b support, and PDF/A version detection --- .../pdfas/common/settings/IProfileConstants.java | 1 + .../common/settings/SignatureProfileSettings.java | 26 +++++++++++++++++++++- 2 files changed, 26 insertions(+), 1 deletion(-) (limited to 'pdf-as-common/src/main') 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 2c2b941b..a2cee944 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 @@ -92,6 +92,7 @@ public interface IProfileConstants { public final static String SIGNFIELD_VALUE = "adobeSignFieldValue"; public final static String TIMEZONE_BASE = "timezone"; public final static String SIG_PDFA1B_VALID = "SIG_PDFA1B_VALID"; + public final static String SIG_PDFA3B_VALID = "SIG_PDFA3B_VALID"; public final static String SIG_PDFUA_FORCE = "SIG_PDFUA_FORCE"; } 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 cbc1d601..b6a1b6ca 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 @@ -39,6 +39,8 @@ public class SignatureProfileSettings implements IProfileConstants { private String profileID; + private String pdfAVersion = null; + private ISettings configuration; public SignatureProfileSettings(String profileID, ISettings configuration) { @@ -203,8 +205,17 @@ public class SignatureProfileSettings implements IProfileConstants { public String getProfileTimeZone() { return this.getValue(TIMEZONE_BASE); } - + + public void setPDFAVersion(String version) { + this.pdfAVersion = version; + } + public boolean isPDFA() { + + if(this.pdfAVersion != null) { + return "1".equals(this.pdfAVersion); + } + SignatureProfileEntry entry = profileInformations.get(SIG_PDFA1B_VALID); if (entry != null) { String value = entry.getCaption(); @@ -221,4 +232,17 @@ public class SignatureProfileSettings implements IProfileConstants { } return false; } + + public boolean isPDFA3() { + if(this.pdfAVersion != null) { + return "3".equals(this.pdfAVersion); + } + + SignatureProfileEntry entry = profileInformations.get(SIG_PDFA3B_VALID); + if (entry != null) { + String value = entry.getCaption(); + return "true".equals(value); + } + return false; + } } -- cgit v1.2.3