summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Abraham <andreas.abraham@egiz.gv.at>2020-11-24 10:42:50 +0100
committerAndreas Abraham <andreas.abraham@egiz.gv.at>2020-11-24 10:42:50 +0100
commit49f4b55deefd0970b3f034d8c427b1be077fe247 (patch)
tree94bcc565f68dd2c8dc57c8681311565e0c3c35dd
parented09587d97f451d8ab00fc20212011b3c5d35f0c (diff)
downloadpdf-over-49f4b55deefd0970b3f034d8c427b1be077fe247.tar.gz
pdf-over-49f4b55deefd0970b3f034d8c427b1be077fe247.tar.bz2
pdf-over-49f4b55deefd0970b3f034d8c427b1be077fe247.zip
smal fix
-rw-r--r--pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/SimpleConfigurationComposite.java8
-rw-r--r--pdf-over-gui/src/main/java/at/asit/pdfover/gui/utils/SignaturePlaceholderCache.java9
-rw-r--r--pdf-over-signer/pdf-over-sigpdfas4/src/main/java/at/asit/pdfover/signer/pdfas/PdfAs4SignatureParameter.java2
3 files changed, 15 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();
diff --git a/pdf-over-signer/pdf-over-sigpdfas4/src/main/java/at/asit/pdfover/signer/pdfas/PdfAs4SignatureParameter.java b/pdf-over-signer/pdf-over-sigpdfas4/src/main/java/at/asit/pdfover/signer/pdfas/PdfAs4SignatureParameter.java
index fbe1edfb..6443c938 100644
--- a/pdf-over-signer/pdf-over-sigpdfas4/src/main/java/at/asit/pdfover/signer/pdfas/PdfAs4SignatureParameter.java
+++ b/pdf-over-signer/pdf-over-sigpdfas4/src/main/java/at/asit/pdfover/signer/pdfas/PdfAs4SignatureParameter.java
@@ -94,6 +94,7 @@ public class PdfAs4SignatureParameter extends SignatureParameter {
@Override
public Image getPlaceholder() {
String sigProfile = getPdfAsSignatureProfileId();
+
String sigEmblem = (getEmblem() == null ? null : getEmblem().getFileName());
String sigNote = getProperty("SIG_NOTE");
@@ -225,6 +226,7 @@ public class PdfAs4SignatureParameter extends SignatureParameter {
@Override
public void setSignatureProfile(String profile) {
+ System.out.println(profile);
this.profile = profile;
}