aboutsummaryrefslogtreecommitdiff
path: root/pdf-as-lib/src/main/java/at/gv
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
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')
-rw-r--r--pdf-as-lib/src/main/java/at/gv/egiz/pdfas/lib/api/IConfigurationConstants.java1
-rw-r--r--pdf-as-lib/src/main/java/at/gv/egiz/pdfas/lib/impl/configuration/SignatureProfileConfiguration.java24
2 files changed, 25 insertions, 0 deletions
diff --git a/pdf-as-lib/src/main/java/at/gv/egiz/pdfas/lib/api/IConfigurationConstants.java b/pdf-as-lib/src/main/java/at/gv/egiz/pdfas/lib/api/IConfigurationConstants.java
index a73a4846..7a955e3f 100644
--- a/pdf-as-lib/src/main/java/at/gv/egiz/pdfas/lib/api/IConfigurationConstants.java
+++ b/pdf-as-lib/src/main/java/at/gv/egiz/pdfas/lib/api/IConfigurationConstants.java
@@ -42,6 +42,7 @@ public interface IConfigurationConstants {
public static final String LEGACY_POSITIONING = ".legacy.pos";
+ public static final String MIN_WIDTH = "minWidth";
public static final String PLACEHOLDER_ID = "placeholder_id";
public static final String PLACEHOLDER_MODE = "placeholder_mode";
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;