Back to Devexpress

PdfGraphics.MeasureString(String, DXFont, SizeF, PdfStringFormat, out Int32, out Int32) Method

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

latest2.6 KB
Original Source

PdfGraphics.MeasureString(String, DXFont, SizeF, PdfStringFormat, 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.v25.2.Drawing.dll

NuGet Package : DevExpress.Pdf.Drawing

Declaration

csharp
public SizeF MeasureString(
    string text,
    DXFont font,
    SizeF layoutSize,
    PdfStringFormat format,
    out int charactersFitted,
    out int linesFilled
)
vb
Public Function MeasureString(
    text As String,
    font As DXFont,
    layoutSize As SizeF,
    format As PdfStringFormat,
    ByRef charactersFitted As Integer,
    ByRef linesFilled As Integer
) As SizeF

Parameters

NameTypeDescription
textString

A string to measure.

| | font | DXFont |

An object that contains font parameters.

| | layoutSize | SizeF |

Specifies the maximum layout area for the text.

| | format | PdfStringFormat |

An object that contains text formatting parameters.

| | charactersFitted | Int32 |

The number of characters in the string.

| | linesFilled | Int32 |

The number of lines in the string.

|

Returns

TypeDescription
SizeF

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.

See Also

PdfGraphics Class

PdfGraphics Members

DevExpress.Pdf Namespace