PdfCanvas.DrawString Method (String, PdfRectangle, PdfTextAlign, PdfVerticalAlign)

Docotic.Pdf library help > BitMiracle.Docotic.Pdf > PdfCanvas Class > PdfCanvas Methods > DrawString Method > DrawString Method (String, PdfRectangle, PdfTextAlign, PdfVerticalAlign)

Note: This API is now obsolete.

Draws the specified text string in the specified rectangle.

Namespace:  BitMiracle.Docotic.Pdf
Assembly:  BitMiracle.Docotic.Pdf (in BitMiracle.Docotic.Pdf.dll)

Syntax

C#
[ObsoleteAttribute("This method is obsolete and will be removed in the next version of the library. Use DrawText(string, PdfTextDrawingOptions) method instead.")]
public void DrawString(
	string text,
	PdfRectangle rect,
	PdfTextAlign align,
	PdfVerticalAlign verticalAlign
)
VB
<ObsoleteAttribute("This method is obsolete and will be removed in the next version of the library. Use DrawText(string, PdfTextDrawingOptions) method instead.")>
Public Sub DrawString ( 
	text As String,
	rect As PdfRectangle,
	align As PdfTextAlign,
	verticalAlign As PdfVerticalAlign
)

Parameters

text
Type: System.String
The string to draw.
rect
Type: BitMiracle.Docotic.Pdf.PdfRectangle
The PdfRectangle structure that specifies the location of the drawn text.
align
Type: BitMiracle.Docotic.Pdf.PdfTextAlign
The horizontal alignment of the drawn text within the rectangle.
verticalAlign
Type: BitMiracle.Docotic.Pdf.PdfVerticalAlign
The vertical alignment of the drawn text within the rectangle.

Remarks

The string represented by the text parameter always spans only one line. Please use DrawText() if you want to draw more than one line of text.

See Also