I have a list of tuples like this:

(x1,y1,x2,y2, textLine)

where (x1,y1) is the lowest left corner and (x2,y2) is the upper right corner of a box which should display the text in testLine, all values x1,y1,x2,y2 are pixel values. I also have two values pageWidth and pageHeight which represents the width and height of a page in pixels. Note I assume that (0,0) is in the lower left corner of the paper in this explanation of my problem.

Now I want to place these text lines on the page where each text line should have width x2-x1 and height y2-y1, and display the text textLine, notice that the rendered text will be stretched due to the restrictions on the widht and height, but that is part of what I want.

Now my end result should be a single paged PDF with all the text lines where each contain textLine and is placed at the positions given in (x1,y1) and (x2,y2).

Now the problem is that PDFBox seems to place text according to the scheme that it has a placement point (x,y) and a scale (sx,sy) of the text. This can of course do what I want above IF I already know the width and height of the final rendered text, but the only problem is I do not know how to get these values :S Any ideas how to get these values or solve my problem in a different way?.

Thanks in advance :)