Back to Devexpress

PdfGraphics.MeasureString(String, DXFont, SizeF) Method

officefileapi-devexpress-dot-pdf-dot-pdfgraphics-dot-measurestring-x28-system-dot-string-devexpress-dot-drawing-dot-dxfont-system-dot-drawing-dot-sizef-x29.md

latest1.8 KB
Original Source

PdfGraphics.MeasureString(String, DXFont, SizeF) Method

Measures the specified string when drawn with the specified font settings.

Namespace : DevExpress.Pdf

Assembly : DevExpress.Pdf.v25.2.Drawing.dll

NuGet Package : DevExpress.Pdf.Drawing

Declaration

csharp
public SizeF MeasureString(
    string text,
    DXFont font,
    SizeF layoutSize
)
vb
Public Function MeasureString(
    text As String,
    font As DXFont,
    layoutSize As SizeF
) As SizeF

Parameters

NameTypeDescription
textString

A text to measure.

| | font | DXFont |

An object that contains font parameters.

| | layoutSize | SizeF |

The maximum layout area for the text.

|

Returns

TypeDescription
SizeF

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.

See Also

PdfGraphics Class

PdfGraphics Members

DevExpress.Pdf Namespace