aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--build.gradle2
-rw-r--r--pdf-as-pdfbox-2/src/main/java/at/gv/egiz/pdfas/lib/impl/signing/pdfbox2/PADESPDFBOXSigner.java17
2 files changed, 15 insertions, 4 deletions
diff --git a/build.gradle b/build.gradle
index 150d8166..8b3d6d60 100644
--- a/build.gradle
+++ b/build.gradle
@@ -18,7 +18,7 @@ task wrapper(type: Wrapper) {
allprojects {
apply plugin: "com.github.ben-manes.versions"
repositories { mavenCentral() }
- version = '4.1.7-RC-0.0.1'
+ version = '4.1.7-RC-0.0.2'
}
configurations {
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 720aec53..eec9b6c1 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
@@ -896,15 +896,26 @@ public class PADESPDFBOXSigner implements IPdfSigner, IConfigurationConstants {
return existingLocations;
}
- //find first available placeholder
+ //find first placeholder_id
public SignaturePlaceholderData checkAvailablePlaceholders(List<SignaturePlaceholderData> placeholders, List<String> existingPlaceholders) {
SignaturePlaceholderData result = null;
if(placeholders!=null) {
for(int i = 0; i < placeholders.size(); ++i) {
+ //take smallest id
if(!existingPlaceholders.contains(placeholders.get(i).getPlaceholderName())) {
- result = placeholders.get(i);
- break;
+ SignaturePlaceholderData spd = placeholders.get(i);
+ if (spd.getId() != null) {
+ if(result == null) {
+ result = spd;
+ } else {
+ String currentID = result.getId();
+ String testID = spd.getId();
+ if(testID.compareToIgnoreCase(currentID) < 0) {
+ result = spd;
+ }
+ }
+ }
}
}
}