Method DrawString
- Namespace
- BitMiracle.Docotic.Pdf
- Assembly
- BitMiracle.Docotic.Pdf.dll
DrawString(IEnumerable<PdfCharacterCode>)
Draws the text defined by the specified character codes starting from the current TextPosition.
public void DrawString(IEnumerable<PdfCharacterCode> characterCodes)
Parameters
characterCodesIEnumerable<PdfCharacterCode>The character codes for the text.
Remarks
This method ignores the current Font value of the canvas. For each character code, there is the Font property. The method uses those fonts to draw text.
Character codes are part of raw PDF strings. Each string is for a particular font. Use the GetCharCodes() method to get character codes for existing text.
The string defined by the characterCodes parameter always spans only
one line.
DrawString(string)
Draws the specified text string starting from the current TextPosition.
public void DrawString(string text)
Parameters
textstringThe string to draw.
Remarks
The string represented by the text parameter always spans
only one line. Please use DrawText(string, PdfTextDrawingOptions) method if you want to draw
more than one line of text.
The Add new text section has an example and more information.
Exceptions
- ArgumentException
textcontains an invalid surrogate pair. Either the first character in the pair is not a valid high surrogate or the second character in the pair is not a valid low surrogate.- CannotShowTextException
textcontains a glyph that cannot be drawn using the current Font.
DrawString(string, PdfStringDrawingOptions)
Draws the specified text string starting from the current TextPosition using the specified options.
public void DrawString(string text, PdfStringDrawingOptions options)
Parameters
textstringThe string to draw.
optionsPdfStringDrawingOptionsThe drawing options.
Remarks
The string represented by the text parameter always spans
only one line. Please use DrawText(string, PdfTextDrawingOptions) method if you want to draw
more than one line of text.
The Add new text section has an example and more information.
Exceptions
- ArgumentException
textcontains an invalid surrogate pair. Either the first character in the pair is not a valid high surrogate or the second character in the pair is not a valid low surrogate.- CannotShowTextException
textcontains a glyph that cannot be drawn using the current Font and cannot be substituted using theoptions.MissingGlyphHandler.
DrawString(double, double, string)
Draws the specified text string starting from the specified position.
public void DrawString(double x, double y, string text)
Parameters
xdoubleThe x-coordinate of the upper-left corner of the drawn text.
ydoubleThe y-coordinate of the upper-left corner of the drawn text.
textstringThe string to draw.
Remarks
The string represented by the text parameter always spans
only one line. Please use DrawText(string, PdfTextDrawingOptions) method if you want to draw
more than one line of text.
The Add new text section has an example and more information.
Exceptions
- ArgumentException
textcontains an invalid surrogate pair. Either the first character in the pair is not a valid high surrogate or the second character in the pair is not a valid low surrogate.- CannotShowTextException
textcontains a glyph that cannot be drawn using the current Font.
DrawString(double, double, string, PdfStringDrawingOptions)
Draws the specified text string starting from the specified position using the specified options.
public void DrawString(double x, double y, string text, PdfStringDrawingOptions options)
Parameters
xdoubleThe x-coordinate of the upper-left corner of the drawn text.
ydoubleThe y-coordinate of the upper-left corner of the drawn text.
textstringThe string to draw.
optionsPdfStringDrawingOptionsThe drawing options.
Remarks
The string represented by the text parameter always spans
only one line. Please use DrawText(string, PdfTextDrawingOptions) method if you want to draw
more than one line of text.
The Add new text section has an example and more information.
Exceptions
- ArgumentException
textcontains an invalid surrogate pair. Either the first character in the pair is not a valid high surrogate or the second character in the pair is not a valid low surrogate.- CannotShowTextException
textcontains a glyph that cannot be drawn using the current Font and cannot be substituted using theoptions.MissingGlyphHandler.
DrawString(PdfPoint, string)
Draws the specified text string starting from the specified position.
public void DrawString(PdfPoint position, string text)
Parameters
positionPdfPointA PdfPoint structure that specifies the upper-left corner of the drawn text.
textstringThe string to draw.
Remarks
The string represented by the text parameter always spans
only one line. Please use DrawText(string, PdfTextDrawingOptions) method if you want to draw
more than one line of text.
The Add new text section has an example and more information.
Exceptions
- ArgumentException
textcontains an invalid surrogate pair. Either the first character in the pair is not a valid high surrogate or the second character in the pair is not a valid low surrogate.- CannotShowTextException
textcontains a glyph that cannot be drawn using the current Font.
DrawString(PdfPoint, string, PdfStringDrawingOptions)
Draws the specified text string starting from the specified position using the specified options.
public void DrawString(PdfPoint position, string text, PdfStringDrawingOptions options)
Parameters
positionPdfPointA PdfPoint structure that specifies the upper-left corner of the drawn text.
textstringThe string to draw.
optionsPdfStringDrawingOptionsThe drawing options.
Remarks
The string represented by the text parameter always spans
only one line. Please use DrawText(string, PdfTextDrawingOptions) method if you want to draw
more than one line of text.
The Add new text section has an example and more information.
Exceptions
- ArgumentException
textcontains an invalid surrogate pair. Either the first character in the pair is not a valid high surrogate or the second character in the pair is not a valid low surrogate.- CannotShowTextException
textcontains a glyph that cannot be drawn using the current Font and cannot be substituted using theoptions.MissingGlyphHandler.