'Declaration
Public Overloads Function DrawTextBox( _ ByVal FontResName As String, _ ByVal Left As Single, _ ByVal Top As Single, _ ByVal Right As Single, _ ByVal Bottom As Single, _ ByVal HorizontalAlignment As TextAlignment, _ ByVal VerticalAlignment As TextAlignment, _ ByVal Text As String, _ ByVal UseFontBBox As Boolean _ ) As GdPictureStatus
public GdPictureStatus DrawTextBox( string FontResName, float Left, float Top, float Right, float Bottom, TextAlignment HorizontalAlignment, TextAlignment VerticalAlignment, string Text, bool UseFontBBox )
public function DrawTextBox( FontResName: String; Left: Single; Top: Single; Right: Single; Bottom: Single; HorizontalAlignment: TextAlignment; VerticalAlignment: TextAlignment; Text: String; UseFontBBox: Boolean ): GdPictureStatus;
public function DrawTextBox( FontResName : String, Left : float, Top : float, Right : float, Bottom : float, HorizontalAlignment : TextAlignment, VerticalAlignment : TextAlignment, Text : String, UseFontBBox : boolean ) : GdPictureStatus;
public: GdPictureStatus DrawTextBox( string* FontResName, float Left, float Top, float Right, float Bottom, TextAlignment HorizontalAlignment, TextAlignment VerticalAlignment, string* Text, bool UseFontBBox )
public: GdPictureStatus DrawTextBox( String^ FontResName, float Left, float Top, float Right, float Bottom, TextAlignment HorizontalAlignment, TextAlignment VerticalAlignment, String^ Text, bool UseFontBBox )
Parameters
- FontResName
- The resource name of the font you prefer for drawing your text.
You can easily obtain this name using the AddStandardFont method or any of the AddTrueTypeFont...() methods. For further assistance, please see the Fonts section of the GdPicturePDF class in the Reference Guide.
- Left
- The horizontal (X) coordinate of the closest point to the currently defined origin, where the text box is located, in the current units used in the PDF document, related to the currently selected page.
- Top
- The vertical (Y) coordinate of the closest point to the currently defined origin, where the text box is located, in the current units used in the PDF document, related to the currently selected page.
- Right
- The horizontal (X) coordinate of the furthest point to the currently defined origin, where the text box is located, in the current units used in the PDF document, related to the currently selected page.
- Bottom
- The vertical (Y) coordinate of the furthest point to the currently defined origin, where the text box is located, in the current units used in the PDF document, related to the currently selected page.
- HorizontalAlignment
- The required horizontal text alignment mode, that is used to draw text within the specified text box.
- VerticalAlignment
- The required vertical text alignment mode, that is used to draw text within the specified text box.
- Text
- The required text to draw. It can be multiline text as well.
- UseFontBBox
- Set this parameter to false (generally used as the default value) if you want to calculate the text height by using the font's ascent and descent properties. The ascent property is the distance from the baseline to the highest grid coordinate used to place an outline point, the descent property to the lowest grid coordinate.
Set this parameter to true if you want to calculate the text height by using the font boundary box. It is an imaginary box that encloses all glyphs from the font, usually as tightly as possible. This helps to increase the line spacing in drawn text.
Return Value
We strongly recommend always checking this status first.