aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/at/gv/egiz/pdfas
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/at/gv/egiz/pdfas')
-rw-r--r--src/main/java/at/gv/egiz/pdfas/impl/api/PdfAsObject.java18
1 files changed, 15 insertions, 3 deletions
diff --git a/src/main/java/at/gv/egiz/pdfas/impl/api/PdfAsObject.java b/src/main/java/at/gv/egiz/pdfas/impl/api/PdfAsObject.java
index 96e5ad1..8b6bd5f 100644
--- a/src/main/java/at/gv/egiz/pdfas/impl/api/PdfAsObject.java
+++ b/src/main/java/at/gv/egiz/pdfas/impl/api/PdfAsObject.java
@@ -5,6 +5,7 @@ package at.gv.egiz.pdfas.impl.api;
import java.io.File;
import java.io.UnsupportedEncodingException;
+import java.text.MessageFormat;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
@@ -104,7 +105,7 @@ public class PdfAsObject implements PdfAs
/**
* The log.
*/
- private static Log log = LogFactory.getLog(CheckHelper.class);
+ private static Log log = LogFactory.getLog(PdfAsObject.class);
private static final String ENABLE_PLACEHOLDER_SEARCH_KEY = "enable_placeholder_search";
@@ -650,12 +651,23 @@ public class PdfAsObject implements PdfAs
signParameters.setSignatureProfileId(defaultProfile);
}
+ boolean fromPlaceholder = false;
TablePos pos = null;
- if (spd != null && spd.getTablePos() != null)
+ if (spd != null && spd.getTablePos() != null){
+ fromPlaceholder = true;
pos = spd.getTablePos();
- else
+ } else
pos = PosHelper.formTablePos(signParameters.getSignaturePositioning());
+ if (!pos.isWauto() && pos.getWidth() < 150) {
+ // very small, warn user
+ String msg = "The {0} for the signature ({1}) is very small. The signature block might not get placed correcty.";
+ String[] arguments = new String[]{ "given width", "" + pos.getWidth()};
+ if (fromPlaceholder)
+ arguments[0] = "width of the placeholder image that will be used";
+ log.warn(MessageFormat.format(msg, arguments));
+ }
+
Signator signator = createSignator(signParameters.getSignatureType());
SignatorInformation signatorInfo = signator.prepareSign(