From 57e6d642bd6d1ab7bece6e9710c82d03e211084d Mon Sep 17 00:00:00 2001 From: knowcenter Date: Fri, 29 Jun 2007 13:34:25 +0000 Subject: minor changes regarding performance speed during verification -a new key added in config to control verification of old textual signatures git-svn-id: https://joinup.ec.europa.eu/svn/pdf-as/trunk@126 7b5415b0-85f9-ee4d-85bd-d5d0c3b42d1c --- pom.xml | 11 +++++++++++ .../egov/egiz/framework/VerificationFilter.java | 22 ++++++++++++++++++++-- .../wag/egov/egiz/pdf/TextualSignature.java | 3 ++- work/cfg/config.properties | 2 ++ 4 files changed, 35 insertions(+), 3 deletions(-) diff --git a/pom.xml b/pom.xml index 9f09d94..869093c 100644 --- a/pom.xml +++ b/pom.xml @@ -47,6 +47,17 @@ +1 + + + amavriqi + Arian Mavriqi + amavriqi@iicm.edu + KnowCenter + + developer + + +1 + diff --git a/src/main/java/at/knowcenter/wag/egov/egiz/framework/VerificationFilter.java b/src/main/java/at/knowcenter/wag/egov/egiz/framework/VerificationFilter.java index 9e7d1b6..da5a8dc 100644 --- a/src/main/java/at/knowcenter/wag/egov/egiz/framework/VerificationFilter.java +++ b/src/main/java/at/knowcenter/wag/egov/egiz/framework/VerificationFilter.java @@ -65,6 +65,7 @@ import at.knowcenter.wag.exactparser.parsing.results.ObjectParseResult; *

* * @author wprinz + * @author amavriqi */ public class VerificationFilter { @@ -177,8 +178,18 @@ public class VerificationFilter } else { + // FIXME make better + //amavriqi: skip checking for old sigs becouse of performance issues + String old_text_sigs = SettingsReader.getInstance().getSetting("check_old_textual_sigs", "false"); + + //amavriqi: if old textual signatures not checked for then + // no need to check Incremental Block 0 + if(old_text_sigs.equalsIgnoreCase("false") && (prev_end == 0)) + { + continue; + } logger_.debug("Extracting text for: " + prev_end + " to " + bpr.next_index); - + Verificator verificator = new TextualVerificator_1_0_0(); List text_holders = verificator.parseBlock(pdf, bpr, prev_end); logger_.debug("text_holders = " + text_holders.size()); @@ -190,6 +201,9 @@ public class VerificationFilter current_block_contains_signature = true; } + // FIXME make better + //amavriqi: only if old textual signatures are checked for + if(old_text_sigs.equalsIgnoreCase("true")){ if (prev_end == 0) { String rest_text = null; @@ -200,6 +214,10 @@ public class VerificationFilter } else { + //a.m. + logger_.debug("Incemental block" + prev_end + " and there are " + text_holders.size() + " text holders"); + logger_.debug("Checking for older textual Signatures"); + logger_.debug("Extracting text to " + bpr.next_index); rest_text = PdfAS.extractNormalizedTextTextual(pdf, bpr.next_index); } @@ -212,7 +230,7 @@ public class VerificationFilter holders.add(0, old_holders.get(0)); } } - + } if (!text_holders.isEmpty()) { List actual_text_holders = throwOutBinHolders(text_holders); diff --git a/src/main/java/at/knowcenter/wag/egov/egiz/pdf/TextualSignature.java b/src/main/java/at/knowcenter/wag/egov/egiz/pdf/TextualSignature.java index 1a3b56b..a52d6dd 100644 --- a/src/main/java/at/knowcenter/wag/egov/egiz/pdf/TextualSignature.java +++ b/src/main/java/at/knowcenter/wag/egov/egiz/pdf/TextualSignature.java @@ -156,8 +156,9 @@ public class TextualSignature // stripper.setStartPage(4); // stripper.setEndPage(4); + logger_.debug("TextualSignator extractTextTextual: Begin stripping text"); String text = stripper.getText(doc); - + logger_.debug("TextualSignator extractTextTextual: Stripping text ended"); doc.close(); //logger_.debug("TextualSignator extractTextTextual="+text); return text; diff --git a/work/cfg/config.properties b/work/cfg/config.properties index 722dbc7..9df5dee 100644 --- a/work/cfg/config.properties +++ b/work/cfg/config.properties @@ -20,6 +20,8 @@ strict_mode=false # added by tzefferer allow_post_sign_modifications=false +# +check_old_textual_sigs=true ############################################# # Signaturdienste -- cgit v1.2.3