Java iText Image position
- by skowron-line
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.