I'm hoping to tell if a piece of text is going to fit at the bottom of a page before I draw it on the page and check its y position.
Does anyone know if this is possible with ABCPDF?
I'm hoping to tell if a piece of text is going to fit at the bottom of a page before I draw it on the page and check its y position.
Does anyone know if this is possible with ABCPDF?
In my experience, the best way to deal with this is not to worry about whether it will fit by trying to measure.
It's not insurmountable, because you can chain text across pages, but that's a different question.
If graphics.Measurestring does not work for you the other option is to literally measure the size of certain fonts so that you know how many letters fit on a line and can then work out how many lines you will have in a given rectangle and size the rectangle accordingly using something like yVal = lineCount * 5.
If I remember correctly I could not use the measurestring function for some reason and so had to do it the awkward way but it did work very well in my situation where I had multiple boxes of varying sizes.
Yep, ABCPDF will tell you this information: yourPdfDocInstance.AddHtml() will return 0 (and not add any text) if text could not be added to the current rectangle