aboutsummaryrefslogtreecommitdiff
path: root/src/main
diff options
context:
space:
mode:
authorpdanner <pdanner@7b5415b0-85f9-ee4d-85bd-d5d0c3b42d1c>2011-01-27 12:44:26 +0000
committerpdanner <pdanner@7b5415b0-85f9-ee4d-85bd-d5d0c3b42d1c>2011-01-27 12:44:26 +0000
commit0f72666691e481b64d8901802e7894cb58b0c2c4 (patch)
tree40e4b5dfe29b92e43129169aef5422b59d85960f /src/main
parentd616c0b3f9af9f71bdf4017eee43abd0e3def03e (diff)
downloadpdf-as-3-0f72666691e481b64d8901802e7894cb58b0c2c4.tar.gz
pdf-as-3-0f72666691e481b64d8901802e7894cb58b0c2c4.tar.bz2
pdf-as-3-0f72666691e481b64d8901802e7894cb58b0c2c4.zip
git-svn-id: https://joinup.ec.europa.eu/svn/pdf-as/trunk@731 7b5415b0-85f9-ee4d-85bd-d5d0c3b42d1c
Diffstat (limited to 'src/main')
-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(