From 022f1cace8a815721af4c0da9fc7bdf66a08413c Mon Sep 17 00:00:00 2001 From: Andreas Fitzek Date: Fri, 24 Oct 2014 15:06:23 +0200 Subject: Font vertical adjustment fixed --- .../at/gv/egiz/pdfas/lib/impl/stamping/pdfbox/TableDrawUtils.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'pdf-as-pdfbox/src') diff --git a/pdf-as-pdfbox/src/main/java/at/gv/egiz/pdfas/lib/impl/stamping/pdfbox/TableDrawUtils.java b/pdf-as-pdfbox/src/main/java/at/gv/egiz/pdfas/lib/impl/stamping/pdfbox/TableDrawUtils.java index 3572ad54..5156d846 100644 --- a/pdf-as-pdfbox/src/main/java/at/gv/egiz/pdfas/lib/impl/stamping/pdfbox/TableDrawUtils.java +++ b/pdf-as-pdfbox/src/main/java/at/gv/egiz/pdfas/lib/impl/stamping/pdfbox/TableDrawUtils.java @@ -215,7 +215,7 @@ public class TableDrawUtils { ascent = ascent / 1000.0f * fontSize; descent = descent / 1000.0f * fontSize; - ty = ty + (descent * (-1)); + //ty = ty + (descent * (-1)); logger.debug("Text tx {} ty {} maxWidth {} textHeight {}", tx, ty, maxWidth, textHeight); @@ -236,9 +236,9 @@ public class TableDrawUtils { contentStream.setFont(textFont, fontSize); } - logger.debug("Writing: " + tx + " : " + (ty - fontSize) + " as " + logger.debug("Writing: " + tx + " : " + (ty - fontSize + (descent * (-1))) + " as " + cell.getType()); - contentStream.moveTextPositionByAmount(tx, (ty - fontSize)); + contentStream.moveTextPositionByAmount(tx, (ty - fontSize + (descent * (-1)))); contentStream.appendRawCommands(fontSize + " TL\n"); for (int k = 0; k < tlines.length; k++) { -- cgit v1.2.3