aboutsummaryrefslogtreecommitdiff
path: root/pdf-as-lib/src/main/java/at/gv/egiz/pdfas/lib/impl
diff options
context:
space:
mode:
authorAndreas Fitzek <andreas.fitzek@iaik.tugraz.at>2016-02-22 08:50:45 +0100
committerAndreas Fitzek <andreas.fitzek@iaik.tugraz.at>2016-02-22 08:50:45 +0100
commita51e5b49070a6e6d4e4723e714b08e08884ddd7b (patch)
tree1176c6c4e6e0d25a82806f6c2ca5a2fc6c5d6682 /pdf-as-lib/src/main/java/at/gv/egiz/pdfas/lib/impl
parent36ddff26736c03a0f02ca636889a130fa1548f35 (diff)
downloadpdf-as-4-a51e5b49070a6e6d4e4723e714b08e08884ddd7b.tar.gz
pdf-as-4-a51e5b49070a6e6d4e4723e714b08e08884ddd7b.tar.bz2
pdf-as-4-a51e5b49070a6e6d4e4723e714b08e08884ddd7b.zip
introduced minimum width for visual signature when positioned with a placeholder
Diffstat (limited to 'pdf-as-lib/src/main/java/at/gv/egiz/pdfas/lib/impl')
-rw-r--r--pdf-as-lib/src/main/java/at/gv/egiz/pdfas/lib/impl/configuration/SignatureProfileConfiguration.java24
1 files changed, 24 insertions, 0 deletions
diff --git a/pdf-as-lib/src/main/java/at/gv/egiz/pdfas/lib/impl/configuration/SignatureProfileConfiguration.java b/pdf-as-lib/src/main/java/at/gv/egiz/pdfas/lib/impl/configuration/SignatureProfileConfiguration.java
index 04448b96..789094cb 100644
--- a/pdf-as-lib/src/main/java/at/gv/egiz/pdfas/lib/impl/configuration/SignatureProfileConfiguration.java
+++ b/pdf-as-lib/src/main/java/at/gv/egiz/pdfas/lib/impl/configuration/SignatureProfileConfiguration.java
@@ -23,12 +23,17 @@
******************************************************************************/
package at.gv.egiz.pdfas.lib.impl.configuration;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
import at.gv.egiz.pdfas.common.settings.ISettings;
import at.gv.egiz.pdfas.lib.api.IConfigurationConstants;
public class SignatureProfileConfiguration extends SpecificBaseConfiguration
implements IConfigurationConstants {
+ private static final Logger logger = LoggerFactory.getLogger(SignatureProfileConfiguration.class);
+
protected String profileID;
public SignatureProfileConfiguration(ISettings configuration,
@@ -37,6 +42,25 @@ public class SignatureProfileConfiguration extends SpecificBaseConfiguration
this.profileID = profileID;
}
+ public float getMinWidth() {
+ String key = SIG_OBJECT + SEPERATOR + profileID + SEPERATOR + MIN_WIDTH;
+
+ String minWidthValue = this.configuration.getValue(key);
+
+ float result = Float.MAX_VALUE;
+
+ if(minWidthValue != null) {
+ try {
+ result = Float.parseFloat(minWidthValue);
+ logger.debug("Got min width for profile {}: {}", profileID, result);
+ } catch(NumberFormatException e) {
+ logger.warn("Configuration Entry: {} should be a float number", key);
+ }
+ }
+
+ return result;
+ }
+
public boolean isVisualSignature() {
String key = SIG_OBJECT + SEPERATOR + profileID + SEPERATOR + TABLE + SEPERATOR + MAIN;