aboutsummaryrefslogtreecommitdiff
path: root/pdf-as-pdfbox-2/src/main/java/at
diff options
context:
space:
mode:
authorEmina Ahmetovic <emina.ahmetovic@egiz.gv.at>2021-01-28 09:13:05 +0100
committerEmina Ahmetovic <emina.ahmetovic@egiz.gv.at>2021-01-28 09:13:05 +0100
commit3df0c815ba9a7fc53412ec2f39d72951e8de9789 (patch)
treecf4672d2704756a69af886666c7d97b31d82a104 /pdf-as-pdfbox-2/src/main/java/at
parent998d312d9010ce4f4e5fc88f76060a0eca20e0bb (diff)
downloadpdf-as-4-3df0c815ba9a7fc53412ec2f39d72951e8de9789.tar.gz
pdf-as-4-3df0c815ba9a7fc53412ec2f39d72951e8de9789.tar.bz2
pdf-as-4-3df0c815ba9a7fc53412ec2f39d72951e8de9789.zip
new RC version, sort placeholders by id
Diffstat (limited to 'pdf-as-pdfbox-2/src/main/java/at')
-rw-r--r--pdf-as-pdfbox-2/src/main/java/at/gv/egiz/pdfas/lib/impl/signing/pdfbox2/PADESPDFBOXSigner.java17
1 files changed, 14 insertions, 3 deletions
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;
+ }
+ }
+ }
}
}
}