We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Text.Position - Determine Y Coorindate Help

Ok, first time poster - be kind please.
I have read many examples but can’t seem to find what I need.
So, for example par.Position = new Aspose.Pdf.Text.Position(100, 600);

I know that Position is (x,y).
X is simple. But if I start the Y at coordinate 710 and I have a font of size 10 but I have a text string of variable length I am having a problem determining if the text took up two “lines” or three “lines” - depending on wrapping. This will determine if the NEXT text that I will place on the document will be at Y position 700 or 690.
I have tried finding the text just placed using the TextFragmentAbsorber absorber = new TextFragmentAbsorber(text); logic, but that just gives the x,y starting position of the text that I just placed - not the (x,y) of the first available spot on the PDF that I can start placing new text.

So, what I am really looking for is the ending position (x,y) of the text that I just placed onto the document so that I can know what (x,y) to use for the next text that I wish to place.

Any suggestions?


Welcome to Aspose forums.

You may get the value of TextFragment.Rectangle property, instead of the Position property. A Rectangle Class object will be returned which will include values of “X of lower left corner” as well as “Y of lower left corner” i.e. LLX,LLY. Then you may add text as per your requirements.

We hope this will be helpful. Please feel free to contact us if you need any further assistance.