diff options
author | Jakob Heher <jakob.heher@iaik.tugraz.at> | 2022-08-03 14:09:46 +0200 |
---|---|---|
committer | Jakob Heher <jakob.heher@iaik.tugraz.at> | 2022-08-03 14:09:46 +0200 |
commit | 8ed8c7ff59cf052aaab1fbe07deca55aa1dcacc0 (patch) | |
tree | 858249b882cccd070ecf918fd9b3971ff1e03def /pdf-over-signer/src/main | |
parent | 761431947a2c6bc1e14ea848b97eee0f9a950171 (diff) | |
download | pdf-over-8ed8c7ff59cf052aaab1fbe07deca55aa1dcacc0.tar.gz pdf-over-8ed8c7ff59cf052aaab1fbe07deca55aa1dcacc0.tar.bz2 pdf-over-8ed8c7ff59cf052aaab1fbe07deca55aa1dcacc0.zip |
exterminate SignaturePlaceholderCache
(it does not offer any measurable benefit)
Diffstat (limited to 'pdf-over-signer/src/main')
-rw-r--r-- | pdf-over-signer/src/main/java/at/asit/pdfover/signer/pdfas/PdfAs4SignatureParameter.java | 26 |
1 files changed, 4 insertions, 22 deletions
diff --git a/pdf-over-signer/src/main/java/at/asit/pdfover/signer/pdfas/PdfAs4SignatureParameter.java b/pdf-over-signer/src/main/java/at/asit/pdfover/signer/pdfas/PdfAs4SignatureParameter.java index 8a011291..aba1e9ac 100644 --- a/pdf-over-signer/src/main/java/at/asit/pdfover/signer/pdfas/PdfAs4SignatureParameter.java +++ b/pdf-over-signer/src/main/java/at/asit/pdfover/signer/pdfas/PdfAs4SignatureParameter.java @@ -30,7 +30,6 @@ import org.slf4j.LoggerFactory; import at.asit.pdfover.signator.BKUs; import at.asit.pdfover.signator.DocumentSource; import at.asit.pdfover.signator.Emblem; -import at.asit.pdfover.signator.SignatureDimension; import at.asit.pdfover.signator.SignaturePosition; import at.gv.egiz.pdfas.lib.api.Configuration; import at.gv.egiz.pdfas.lib.api.PdfAs; @@ -79,19 +78,8 @@ public class PdfAs4SignatureParameter { private HashMap<String, String> genericProperties = new HashMap<String, String>(); - /** - * This parameters are defining the signature block size - */ - private int sig_w = 229; - private int sig_h = 77; - public String signatureProfileName = Profile.getDefaultProfile(); - // TODO why is this stored separately? - public SignatureDimension getPlaceholderDimension() { - return new SignatureDimension(this.sig_w, this.sig_h); - } - public Image getPlaceholder() { String sigProfile = getPdfAsSignatureProfileId(); @@ -108,19 +96,13 @@ public class PdfAs4SignatureParameter { if (sigNote != null) { conf.setValue("sig_obj." + sigProfile + ".value.SIG_NOTE", sigNote); } - SignParameter param = PdfAsFactory - .createSignParameter(conf, null, null); + SignParameter param = PdfAsFactory.createSignParameter(conf, null, null); param.setSignatureProfileId(sigProfile); - Image img = pdfas.generateVisibleSignaturePreview(param, cert, 72 * 4); - this.sig_w = img.getWidth(null) / 4; - this.sig_h = img.getHeight(null) / 4; - - return img; + + return pdfas.generateVisibleSignaturePreview(param, cert, 72 * 4); } catch (Exception e) { log.error("Failed to get signature placeholder", e); - return new BufferedImage(getPlaceholderDimension().getWidth(), - getPlaceholderDimension().getHeight(), - BufferedImage.TYPE_INT_RGB); + return new BufferedImage(229, 77, BufferedImage.TYPE_INT_RGB); } } |