aboutsummaryrefslogtreecommitdiff
path: root/pdf-as-pdfbox-2/src/main/java/at/gv
diff options
context:
space:
mode:
authorEmina Ahmetovic <emina.ahmetovic@egiz.gv.at>2020-12-18 11:24:22 +0100
committerEmina Ahmetovic <emina.ahmetovic@egiz.gv.at>2020-12-18 11:24:22 +0100
commit78a01744e1fc3e8d45348b623a3a80906d31e373 (patch)
treecea98ff34a26b15534d52c0108546282cadbdcd1 /pdf-as-pdfbox-2/src/main/java/at/gv
parent23a0c0bfd0054e4dc1a461a2eda76d7fb1f61fb9 (diff)
downloadpdf-as-4-78a01744e1fc3e8d45348b623a3a80906d31e373.tar.gz
pdf-as-4-78a01744e1fc3e8d45348b623a3a80906d31e373.tar.bz2
pdf-as-4-78a01744e1fc3e8d45348b623a3a80906d31e373.zip
clear placeholders, add additional parameters in a default config
Diffstat (limited to 'pdf-as-pdfbox-2/src/main/java/at/gv')
-rw-r--r--pdf-as-pdfbox-2/src/main/java/at/gv/egiz/pdfas/lib/impl/pdfbox2/placeholder/SignaturePlaceholderExtractor.java7
-rw-r--r--pdf-as-pdfbox-2/src/main/java/at/gv/egiz/pdfas/lib/impl/signing/pdfbox2/PADESPDFBOXSigner.java3
2 files changed, 8 insertions, 2 deletions
diff --git a/pdf-as-pdfbox-2/src/main/java/at/gv/egiz/pdfas/lib/impl/pdfbox2/placeholder/SignaturePlaceholderExtractor.java b/pdf-as-pdfbox-2/src/main/java/at/gv/egiz/pdfas/lib/impl/pdfbox2/placeholder/SignaturePlaceholderExtractor.java
index f1aa78b6..9043aae7 100644
--- a/pdf-as-pdfbox-2/src/main/java/at/gv/egiz/pdfas/lib/impl/pdfbox2/placeholder/SignaturePlaceholderExtractor.java
+++ b/pdf-as-pdfbox-2/src/main/java/at/gv/egiz/pdfas/lib/impl/pdfbox2/placeholder/SignaturePlaceholderExtractor.java
@@ -128,10 +128,13 @@ public class SignaturePlaceholderExtractor extends PDFStreamEngine implements Pl
this.doc = doc;
}
- //todo lists returns duplicates
- public static List<SignaturePlaceholderData> listPlaceholders() {
+ public static List<SignaturePlaceholderData> listPlaceholders() {
return placeholders;
}
+
+ public static void clearPlaceholders(){
+ placeholders.clear();
+ }
/**
* Search the document for placeholder images and possibly included
* additional info.<br/>
diff --git a/pdf-as-pdfbox-2/src/main/java/at/gv/egiz/pdfas/lib/impl/signing/pdfbox2/PADESPDFBOXSigner.java b/pdf-as-pdfbox-2/src/main/java/at/gv/egiz/pdfas/lib/impl/signing/pdfbox2/PADESPDFBOXSigner.java
index 8f67c96b..82c48d96 100644
--- a/pdf-as-pdfbox-2/src/main/java/at/gv/egiz/pdfas/lib/impl/signing/pdfbox2/PADESPDFBOXSigner.java
+++ b/pdf-as-pdfbox-2/src/main/java/at/gv/egiz/pdfas/lib/impl/signing/pdfbox2/PADESPDFBOXSigner.java
@@ -157,6 +157,9 @@ public class PADESPDFBOXSigner implements IPdfSigner, IConfigurationConstants {
//gives a list of all placeholders
List<SignaturePlaceholderData> placeholders = SignaturePlaceholderExtractor.listPlaceholders();
+ if(placeholders!=null){
+ SignaturePlaceholderExtractor.clearPlaceholders();
+ }
if(placeholder_id.equalsIgnoreCase("")){
if(checkAvailablePlaceholders(placeholders,existingSignatureLocations(doc))!=null)
{