As I have explained in my first message, my main issue is when Accented Characters are found in the first line and if columnText.setUseAscender(true), then the accent goes above the given Y Position. I found two workarounds to fix this issue.
1st: Set columnText.setUseAscender(false). Set paragraph.setLeading(0.0f,0.8f) only for the first line being stamped and for the following lines, set the leading to paragraph.setLeading(0.0f,1.2f). Achieving this would give me the correct results. But I could not find a way to apply one leading to the first line and another one to the following lines. So the 2nd workaround. 2nd: Keep columnText.setUseAscender(true) to align the text with the given Y position. Set paragraph.setLeading(0.0f,1.2f). And to make sure that Accented Characters do not go above the Y position, add a padding of (maxFontSize in the first line * 0.2f) on a cell. That way my text correctly aligns with the given Y position and also the Accented characters get stamped correctly. 1T3XT info wrote: > > Vrishali wrote: >> I found a workaround to fix it by using the padding top on a cell. But >> padding top value would depend on the biggest font size in the first >> line. >> Does anyone know the way to get the biggest font size in the first line? > > There's a method in PdfLine that gives you the maximum size > of the font, but... I don't understand why you need it. > It is package private and used in ColumnText to determine > the leading (among others for the first line). > > I honestly don't understand your question (and why you would > need the biggest font size), but I suggest that you look into > the iText source code to understand how it works. > -- > This answer is provided by 1T3XT BVBA > > ------------------------------------------------------------------------- > This SF.net email is sponsored by: Microsoft > Defy all challenges. Microsoft(R) Visual Studio 2008. > http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ > _______________________________________________ > iText-questions mailing list > [email protected] > https://lists.sourceforge.net/lists/listinfo/itext-questions > > Do you like iText? > Buy the iText book: http://www.1t3xt.com/docs/book.php > Or leave a tip: https://tipit.to/itexttipjar > > -- View this message in context: http://www.nabble.com/Issue-with-stamping-of-Accented-Characters-tp17316750p17427092.html Sent from the iText - General mailing list archive at Nabble.com. ------------------------------------------------------------------------- This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2008. http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ _______________________________________________ iText-questions mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/itext-questions Do you like iText? Buy the iText book: http://www.1t3xt.com/docs/book.php Or leave a tip: https://tipit.to/itexttipjar
