Draws the specified text string in the specified rectangle using
specified formatting options.
Namespace:
BitMiracle.Docotic.Pdf
Assembly:
BitMiracle.Docotic.Pdf (in BitMiracle.Docotic.Pdf.dll)
Syntax
C#
public int DrawText(
string text,
PdfRectangle rect,
PdfTextAlign align,
PdfVerticalAlign verticalAlign,
double lineHeight,
bool drawAtLeastOneLine
)
VB
Public Function DrawText (
text As String,
rect As PdfRectangle,
align As PdfTextAlign,
verticalAlign As PdfVerticalAlign,
lineHeight As Double,
drawAtLeastOneLine As Boolean
) As Integer
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. - lineHeight
- Type: System.Double
Height of the one line of drawn text
(distance between top lines of two consecutive strings). - drawAtLeastOneLine
- Type: System.Boolean
if set to true than at least
one clipped line of text will be drawn.
Return Value
Type:
Int32The number of characters drawn.
Remarks
The text represented by the
text
parameter may be drawn in multiple lines. This method clips the
text so that it does not appear outside the specified rectangle.
Lines are automatically broken between words if a word would extend
past the edge of the rectangle specified by the
rect parameter. A carriage return-line feed
sequence also breaks the line.
Please use
DrawString() if you
want to draw only one line of text.
See Also