Java iText Image position

Posted by skowron-line on Stack Overflow See other posts from Stack Overflow or by skowron-line
Published on 2011-04-28T08:36:11Z Indexed on 2012/10/24 17:01 UTC
Read the original article Hit count: 184

Filed under:
|

I have:

   Image i = Image.getInstance("tabelka.png");
        i.scalePercent(25, 25);
    for(int i=0; i<= 5; i++)
    {
        doc.add(i);

        content.moveTo(50, ??);////// <-------------- HOW TO CHECK THE Y POSITION
        content.showText("skowron-line");
    }

I want to set text on upper right corner of image. How do I do that?

EIDT: After hours of thinkin i found dirty solution:

Image img = Image.getInstance("tabelka.png");
img.scalePercent(25, 25);
float start = x;
for(int i =1; i<= 5; i++)
{
  start = (x - (img.getHeight() * 0.25f) * i);
}

If U know better solution let me know.

© Stack Overflow or respective owner

Related posts about java

Related posts about itext