Docotic.Pdf Library Help > BitMiracle.Docotic.Pdf > PdfCanvas Class > PdfCanvas Methods > DrawString Method > DrawString Method (String, PdfRectangle, PdfTextAlign, PdfVerticalAlign)
Draws the specified text string in the specified rectangle.

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

Syntax

C#
public void DrawString(
	string text,
	PdfRectangle rect,
	PdfTextAlign align,
	PdfVerticalAlign verticalAlign
)
VB
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 Overload if you want to draw more the one line of text.

See Also