aboutsummaryrefslogtreecommitdiff
path: root/pdf-as-lib/src/main/java/at/gv
diff options
context:
space:
mode:
authorAndreas Fitzek <andreas.fitzek@iaik.tugraz.at>2014-06-05 10:16:49 +0200
committerAndreas Fitzek <andreas.fitzek@iaik.tugraz.at>2014-06-05 10:16:49 +0200
commit531124af765490a63c3a1121ba81fed21c6d7ab4 (patch)
treebc7dab86aa3d51c166f3a368c8ffa7302a816c93 /pdf-as-lib/src/main/java/at/gv
parent94c33f3d604ebf9a37dba551eb822b57ebfea902 (diff)
downloadpdf-as-4-531124af765490a63c3a1121ba81fed21c6d7ab4.tar.gz
pdf-as-4-531124af765490a63c3a1121ba81fed21c6d7ab4.tar.bz2
pdf-as-4-531124af765490a63c3a1121ba81fed21c6d7ab4.zip
halign fixes
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/impl/stamping/pdfbox/PDFAsVisualSignatureBuilder.java11
1 files changed, 7 insertions, 4 deletions
diff --git a/pdf-as-lib/src/main/java/at/gv/egiz/pdfas/lib/impl/stamping/pdfbox/PDFAsVisualSignatureBuilder.java b/pdf-as-lib/src/main/java/at/gv/egiz/pdfas/lib/impl/stamping/pdfbox/PDFAsVisualSignatureBuilder.java
index 3885169b..d2049f24 100644
--- a/pdf-as-lib/src/main/java/at/gv/egiz/pdfas/lib/impl/stamping/pdfbox/PDFAsVisualSignatureBuilder.java
+++ b/pdf-as-lib/src/main/java/at/gv/egiz/pdfas/lib/impl/stamping/pdfbox/PDFAsVisualSignatureBuilder.java
@@ -28,7 +28,6 @@ import org.apache.pdfbox.pdmodel.edit.PDPageContentStream;
import org.apache.pdfbox.pdmodel.font.PDFont;
import org.apache.pdfbox.pdmodel.font.PDType1Font;
import org.apache.pdfbox.pdmodel.graphics.xobject.PDJpeg;
-import org.apache.pdfbox.pdmodel.graphics.xobject.PDPixelMap;
import org.apache.pdfbox.pdmodel.graphics.xobject.PDXObjectForm;
import org.apache.pdfbox.pdmodel.graphics.xobject.PDXObjectImage;
import org.apache.pdfbox.pdmodel.interactive.annotation.PDAppearanceDictionary;
@@ -280,11 +279,15 @@ public class PDFAsVisualSignatureBuilder extends PDVisibleSigBuilder {
float tx = textx;
if(Style.CENTER.equals(halign)) {
float offset = columnWidth - maxWidth - 2 * padding;
- offset = offset / 2.0f;
- tx += offset;
+ if(offset > 0) {
+ offset = offset / 2.0f;
+ tx += offset;
+ }
} else if(Style.RIGHT.equals(halign)) {
float offset = columnWidth - maxWidth - 2 * padding;
- tx += offset;
+ if(offset > 0) {
+ tx += offset;
+ }
}
logger.debug("Writing: " + tx + " : " + ty + " = "