How to get the Width or Height of a String

You may want to know before writing some text how much horizontaol space it would take: PDFReport provides for this purpose the method "GetTextBoxWidth"; this method calculates how large is the string passed as the parameter, given the current Font Name, Font Height.

The result is expressed in the current UnitOfMeasure (default is millimeters). This method doesn't consider or take care of the existance in the string of CRLF (which will be deleted).

On the other side, "GetTextBoxLines" returns the number of lines on which a text will wrap, given the current Font Height, Font Name, Paragraph Width. The result creates a virtual text box large as defined in the ParagraphWidth property and flows the text inside it (taking also care of eventual CrLf).

The number of lines is returned to the calling program; if you need to know the exact height of the resulting virtual box, just multiply it for the value of the property "ParagraphLeading".