peter.henning...@wcenter.de wrote: > > Good morning! > > I applied and tested the patch this morning. It seems to work great, but > only in text-mode. Unfortunately, we are doing everything in > composite-mode, where the > method getLastX() will always return 0.0. > > I also noticed that the method writeLineToContent(line, text, graphics, > currentValues, ratio) in class PDFDocument > is also called in PDFDocument.flushLines() and it loses the x-position > there. Unfortunately, that method already has a return parameter. No > easy fix, but maybe no problem?
I have no idea what you're talking about, but this is a fix for composite mode: Modified Paths: -------------- trunk/src/core/com/itextpdf/text/pdf/ColumnText.java trunk/src/core/com/itextpdf/text/pdf/PdfDocument.java Modified: trunk/src/core/com/itextpdf/text/pdf/ColumnText.java =================================================================== --- trunk/src/core/com/itextpdf/text/pdf/ColumnText.java 2010-04-28 14:27:05 UTC (rev 4495) +++ trunk/src/core/com/itextpdf/text/pdf/ColumnText.java 2010-04-28 15:00:19 UTC (rev 4496) @@ -1189,6 +1189,7 @@ compositeColumn.maxY = maxY; boolean keepCandidate = para.getKeepTogether() && createHere && !firstPass; status = compositeColumn.go(simulate || keepCandidate && keep == 0); + lastX = compositeColumn.getLastX(); updateFilledWidth(compositeColumn.filledWidth); if ((status & NO_MORE_TEXT) == 0 && keepCandidate) { compositeColumn = null; @@ -1285,6 +1286,7 @@ compositeColumn.maxY = maxY; boolean keepCandidate = item.getKeepTogether() && createHere && !firstPass; status = compositeColumn.go(simulate || keepCandidate && keep == 0); + lastX = compositeColumn.getLastX(); updateFilledWidth(compositeColumn.filledWidth); if ((status & NO_MORE_TEXT) == 0 && keepCandidate) { compositeColumn = null; Modified: trunk/src/core/com/itextpdf/text/pdf/PdfDocument.java =================================================================== --- trunk/src/core/com/itextpdf/text/pdf/PdfDocument.java 2010-04-28 14:27:05 UTC (rev 4495) +++ trunk/src/core/com/itextpdf/text/pdf/PdfDocument.java 2010-04-28 15:00:19 UTC (rev 4496) @@ -1302,7 +1302,7 @@ lastBaseFactor = baseFactor; } } - else if (line.alignment == Element.ALIGN_LEFT) { + else if (line.alignment == Element.ALIGN_LEFT || line.alignment == Element.ALIGN_UNDEFINED) { lastX -= line.widthLeft(); } -- This answer is provided by 1T3XT BVBA http://www.1t3xt.com/ - http://www.1t3xt.info ------------------------------------------------------------------------------ _______________________________________________ iText-questions mailing list iText-questions@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/itext-questions Buy the iText book: http://www.itextpdf.com/book/ Check the site with examples before you ask questions: http://www.1t3xt.info/examples/ You can also search the keywords list: http://1t3xt.info/tutorials/keywords/