0

some days ago i asked a question about printing Rectangle outlining a text . Here's is the answer for my question. And this works perfect wenn text Alignment is Element.LEFT, which is default.

when i try to align text center or right, the text is drawn to a different potion than expected so that the Rectangle around the text is not corect.

am i doing some thing wrong?

For all alignments i am using this method in itext...

ColumnText ct = new ColumnText(cb);
ct.setSimpleColumn(llx, lly, urx, ury);

to get the widt i do...

ct.getFillWidth();

to get the height...`

ct.getYLine();

Why this doesn work for CENTER and RIGHT alignments? Please take a lokk to my results

this bold lines seems to be equal, but how to get it programmaticaly

Thanks in advance

Community
  • 1
  • 1
user2439522
  • 27
  • 1
  • 7
  • 1
    You're going to have to give us a little bit more information. Can you provide a [SSCCE](http://sscce.org) we can use to reproduce the problem? – Bruno Lowagie Apr 16 '15 at 14:43
  • Ok i will try to extract this from mycode, but for now, please take a look to my edited image, the bold lines seems to equal, does it help? – user2439522 Apr 16 '15 at 17:10

0 Answers0