diff options
author | Andreas Abraham <andreas.abraham@egiz.gv.at> | 2020-11-24 10:42:50 +0100 |
---|---|---|
committer | Andreas Abraham <andreas.abraham@egiz.gv.at> | 2020-11-24 10:42:50 +0100 |
commit | 49f4b55deefd0970b3f034d8c427b1be077fe247 (patch) | |
tree | 94bcc565f68dd2c8dc57c8681311565e0c3c35dd /pdf-over-gui/src/main/java/at/asit/pdfover/gui | |
parent | ed09587d97f451d8ab00fc20212011b3c5d35f0c (diff) | |
download | pdf-over-49f4b55deefd0970b3f034d8c427b1be077fe247.tar.gz pdf-over-49f4b55deefd0970b3f034d8c427b1be077fe247.tar.bz2 pdf-over-49f4b55deefd0970b3f034d8c427b1be077fe247.zip |
smal fix
Diffstat (limited to 'pdf-over-gui/src/main/java/at/asit/pdfover/gui')
-rw-r--r-- | pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/SimpleConfigurationComposite.java | 8 | ||||
-rw-r--r-- | pdf-over-gui/src/main/java/at/asit/pdfover/gui/utils/SignaturePlaceholderCache.java | 9 |
2 files changed, 13 insertions, 4 deletions
diff --git a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/SimpleConfigurationComposite.java b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/SimpleConfigurationComposite.java index 8fd94eb7..18aad38a 100644 --- a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/SimpleConfigurationComposite.java +++ b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/SimpleConfigurationComposite.java @@ -742,16 +742,20 @@ public class SimpleConfigurationComposite extends BaseConfigurationComposite { if (selected.equals(Profile.AMTSSIGNATURBLOCK) || selected.equals(Profile.INVISIBLE)){ this.configurationContainer.setDefaultSignaturePosition(new SignaturePosition()); } - + setSignatureProfileSetting(); } void setSignatureProfileSetting(){ + if (this.signer == null){ + log.debug("In setSignatureProfileSettings: Signer was null"); + return; + } try { SignatureParameter param = this.signer.getPDFSigner().newParameter(); param.setSignatureProfile(this.configurationContainer.getSignatureProfile().name()); } catch (Exception e){ - log.debug("Cannot save signature profile {}", e.getMessage()); + log.warn("Cannot save signature profile {}", e.getMessage()); } } diff --git a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/utils/SignaturePlaceholderCache.java b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/utils/SignaturePlaceholderCache.java index 6dc93ae9..92cece82 100644 --- a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/utils/SignaturePlaceholderCache.java +++ b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/utils/SignaturePlaceholderCache.java @@ -72,6 +72,7 @@ public class SignaturePlaceholderCache { final String sigEHshProp = "EHSH"; //$NON-NLS-1$ final String sigPdfAProp = "PDFA"; //$NON-NLS-1$ final String sigNoteProp = "NOTE"; //$NON-NLS-1$ + final String sigProfProp = "PROF"; //$NON-NLS-1$ String sigLang = param.getSignatureLanguage(); String sigEmbl = ""; //$NON-NLS-1$ @@ -89,7 +90,10 @@ public class SignaturePlaceholderCache { String sigNote = param.getProperty("SIG_NOTE"); //$NON-NLS-1$ if (sigNote == null) sigNote = ""; //$NON-NLS-1$ - + String profile = param.getSignatureProfile(); + if (profile == null){ + profile = ""; + } Properties sigProps = new Properties(); // compare cache, try to load if match try { @@ -99,7 +103,7 @@ public class SignaturePlaceholderCache { sigEmbl.equals(sigProps.getProperty(sigEmblProp)) && sigEHsh.equals(sigProps.getProperty(sigEHshProp)) && sigNote.equals(sigProps.getProperty(sigNoteProp)) && - sigPdfA.equals(sigProps.getProperty(sigPdfAProp))) { + sigPdfA.equals(sigProps.getProperty(sigPdfAProp)) ) { log.debug("Placeholder cache hit"); //$NON-NLS-1$ return loadImage(fileDir, imgFileName, imgFileExt); } @@ -120,6 +124,7 @@ public class SignaturePlaceholderCache { sigProps.setProperty(sigEHshProp, sigEHsh); sigProps.setProperty(sigNoteProp, sigNote); sigProps.setProperty(sigPdfAProp, sigPdfA); + sigProps.setProperty(sigProfProp, profile); OutputStream out = new FileOutputStream(new File(fileDir, propFileName)); sigProps.store(out, null); Image img = param.getPlaceholder(); |