PDF for UWP | ComponentOne
C1.Xaml.Pdf Namespace / C1PdfDocument Class / MeasureString Method / MeasureString(String,Font,Double) Method
String to measure.
Font object that defines the appearance and size of the text.
Maximum width of the string.

In This Topic
    MeasureString(String,Font,Double) Method
    In This Topic
    Measures the specified string when drawn with a given Font object into a rectangle with the specified width.
    Syntax
    'Declaration
     
    
    Public Overloads Function MeasureString( _
       ByVal text As String, _
       ByVal font As Font, _
       ByVal width As Double _
    ) As Size
    public Size MeasureString( 
       string text,
       Font font,
       double width
    )

    Parameters

    text
    String to measure.
    font
    Font object that defines the appearance and size of the text.
    width
    Maximum width of the string.

    Return Value

    The size of the string expressed in points.
    Remarks
    This overload wraps the string to prevent any lines from getting wider than the width parameter. The value returned contains the given width and the height needed to render the entire string.
    See Also