PdfGraphics.MeasureString(String, Font, SizeF, PdfStringFormat, Single, Single, out Int32, out Int32) Method
Measures a string when it is drawn with the specific font and text formatting settings.
Namespace: DevExpress.Pdf
Assembly: DevExpress.Pdf.v24.2.Drawing.dll
NuGet Package: DevExpress.Pdf.Drawing
#Declaration
public SizeF MeasureString(
string text,
Font font,
SizeF layoutSize,
PdfStringFormat format,
float dpiX,
float dpiY,
out int charactersFitted,
out int linesFilled
)
#Parameters
Name | Type | Description |
---|---|---|
text | String | A string to measure. |
font | Font | An object that contains font parameters. |
layout |
Size |
Specifies the maximum layout area for the text. |
format | Pdf |
An object that contains text formatting parameters. |
dpi |
Single | The horizontal resolution (in dots per inch). The default value is 96. |
dpi |
Single | The vertical resolution (in dots per inch). The default value is 96. |
characters |
Int32 | The number of characters in the string. |
lines |
Int32 | The number of lines in the string. |
#Returns
Type | Description |
---|---|
Size |
The string’s measured size. |
#Remarks
Use this method to calculate the size of the drawn text. Use the returned SizeF object to calculate a page area or a point where you can draw text.