PdfGraphics.MeasureString(String, Font, SizeF, PdfStringFormat, Single, Single) Method
Measures the specified string when drawn with specified font and text formatting parameters. Allows you to specify text layout size, and horizontal and vertical resolutions.
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
)
#Parameters
Name | Type | Description |
---|---|---|
text | String | A text to measure. |
font | Font | An object that defines font parameters. |
layout |
Size |
The maximum layout area for the text. |
format | Pdf |
An object that defines 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. |
#Returns
Type | Description |
---|---|
Size |
The string’s measured size. |
#Remarks
Use this method to calculate a size of the drawn text. Use the returned SizeF object to calculate a page area or a point where you can draw text.