diff options
author | Andreas Fitzek <andreas.fitzek@iaik.tugraz.at> | 2014-06-05 10:16:49 +0200 |
---|---|---|
committer | Andreas Fitzek <andreas.fitzek@iaik.tugraz.at> | 2014-06-05 10:16:49 +0200 |
commit | 531124af765490a63c3a1121ba81fed21c6d7ab4 (patch) | |
tree | bc7dab86aa3d51c166f3a368c8ffa7302a816c93 /pdf-as-lib/src | |
parent | 94c33f3d604ebf9a37dba551eb822b57ebfea902 (diff) | |
download | pdf-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')
-rw-r--r-- | pdf-as-lib/src/main/java/at/gv/egiz/pdfas/lib/impl/stamping/pdfbox/PDFAsVisualSignatureBuilder.java | 11 |
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 + " = " |