Click or drag to resize

PdfFontMetricsMeasureText Method (Double, String)

Measures the given text in the provided font size in points.

Namespace:  Atalasoft.PdfDoc.Generating.ResourceHandling.Fonts
Assembly:  Atalasoft.PdfDoc (in Atalasoft.PdfDoc.dll) Version: 11.4.0.9.0.377 (.NET 4.5.2, x86)
Syntax
public PdfPoint MeasureText(
	double pointSize,
	string text
)

Parameters

pointSize
Type: SystemDouble
Size of the font in points.
text
Type: SystemString
The text to be measured.

Return Value

Type: PdfPoint
The size of the text provided. In practice, this measurement represents what is known as the Advance Width of a given string. The is the amount and the direction that the text origin would be moved by placing the text. If the font represents a left to right writing system, the X value of the returned point will be set to "width" of the text and the Y value will be 0. Vertical writing systems are not currently supported.
Examples
PdfPoint size = metrics.MeasureText(12.0, "Bivalve farming");
See Also