summaryrefslogtreecommitdiff
path: root/pdf-over-gui/src/main/java/at/asit/pdfover/gui/utils
diff options
context:
space:
mode:
authorTobias Kellner <tobias.kellner@iaik.tugraz.at>2016-10-10 18:35:33 +0200
committerTobias Kellner <tobias.kellner@iaik.tugraz.at>2016-10-25 17:00:13 +0200
commit5962867b411bc53bf14938b0312414f040986b54 (patch)
tree91c25af9dd61249f047f0567e0f72b87abda3091 /pdf-over-gui/src/main/java/at/asit/pdfover/gui/utils
parent1f614332bcd103229f15f51157a52824005fba96 (diff)
downloadmocca-5962867b411bc53bf14938b0312414f040986b54.tar.gz
mocca-5962867b411bc53bf14938b0312414f040986b54.tar.bz2
mocca-5962867b411bc53bf14938b0312414f040986b54.zip
Cache (and scale) custom emblem images
Diffstat (limited to 'pdf-over-gui/src/main/java/at/asit/pdfover/gui/utils')
-rw-r--r--pdf-over-gui/src/main/java/at/asit/pdfover/gui/utils/SignaturePlaceholderCache.java12
1 files changed, 11 insertions, 1 deletions
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 87ce24ee..306f74b7 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
@@ -33,6 +33,8 @@ import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import at.asit.pdfover.gui.Constants;
+import at.asit.pdfover.signator.CachedFileNameEmblem;
+import at.asit.pdfover.signator.Emblem;
import at.asit.pdfover.signator.SignatureParameter;
/**
@@ -71,7 +73,15 @@ public class SignaturePlaceholderCache {
final String sigNoteProp = "NOTE"; //$NON-NLS-1$
String sigLang = param.getSignatureLanguage();
- String sigEmbl = (param.getEmblem() == null ? "" : param.getEmblem().getFileName()); //$NON-NLS-1$
+ String sigEmbl = ""; //$NON-NLS-1$
+ if (param.getEmblem() != null) {
+ Emblem embl = param.getEmblem();
+ if (embl instanceof CachedFileNameEmblem) {
+ sigEmbl = ((CachedFileNameEmblem) embl).getOriginalFileName();
+ } else {
+ sigEmbl = embl.getFileName();
+ }
+ }
String sigPdfA = param.getSignaturePdfACompat() ? Constants.TRUE : Constants.FALSE;
String sigNote = param.getProperty("SIG_NOTE"); //$NON-NLS-1$
if (sigNote == null)