aboutsummaryrefslogtreecommitdiff
path: root/pdf-as-pdfbox-2/src/main/java/at/gv/egiz/pdfas/lib
diff options
context:
space:
mode:
authorAlexander Marsalek <amarsalek@iaik.tugraz.at>2021-06-01 11:24:58 +0200
committerAlexander Marsalek <amarsalek@iaik.tugraz.at>2021-06-01 11:25:26 +0200
commitbf0aa0afbb336ec5d5acb719e130d42f15bc8900 (patch)
tree330f08ac1671a9a993e59dfef1d87a392234d0e5 /pdf-as-pdfbox-2/src/main/java/at/gv/egiz/pdfas/lib
parentca954e8fc5832a7ff686e0b878951079d8f8fe12 (diff)
parent3fde4b0164d1eb2f3fb32718b4011fff2b2b80ed (diff)
downloadpdf-as-4-bf0aa0afbb336ec5d5acb719e130d42f15bc8900.tar.gz
pdf-as-4-bf0aa0afbb336ec5d5acb719e130d42f15bc8900.tar.bz2
pdf-as-4-bf0aa0afbb336ec5d5acb719e130d42f15bc8900.zip
Merge branch 'feature/issue_44' into master
Diffstat (limited to 'pdf-as-pdfbox-2/src/main/java/at/gv/egiz/pdfas/lib')
-rw-r--r--pdf-as-pdfbox-2/src/main/java/at/gv/egiz/pdfas/lib/impl/signing/pdfbox2/PADESPDFBOXSigner.java19
1 files changed, 14 insertions, 5 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 a33517cb..3cf0853f 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
@@ -938,16 +938,25 @@ public class PADESPDFBOXSigner implements IPdfSigner, IConfigurationConstants {
if(placeholders!=null) {
for(int i = 0; i < placeholders.size(); ++i) {
//take smallest id
- if(!existingPlaceholders.contains(placeholders.get(i).getPlaceholderName())) {
+ if(!existingPlaceholders.contains(placeholders.get(i).getPlaceholderName())) {
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;
+ try{
+ int currentID = Integer.parseInt(result.getId());
+ int testID = Integer.parseInt(spd.getId());
+ if(testID < currentID) {
+ result = spd;
+ }
+ }catch(Exception e){
+ //fallback to string compare
+ String currentID = result.getId();
+ String testID = spd.getId();
+ if(testID.compareToIgnoreCase(currentID) < 0) {
+ result = spd;
+ }
}
}
}