aboutsummaryrefslogtreecommitdiff
path: root/pdf-as-pdfbox-2
diff options
context:
space:
mode:
Diffstat (limited to 'pdf-as-pdfbox-2')
-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)
{