Table of Contents

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

characterCodes IEnumerable<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

text string

The 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

text contains 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

text contains 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

text string

The string to draw.

options PdfStringDrawingOptions

The 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

text contains 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

text contains a glyph that cannot be drawn using the current Font and cannot be substituted using the options.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

x double

The x-coordinate of the upper-left corner of the drawn text.

y double

The y-coordinate of the upper-left corner of the drawn text.

text string

The 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

text contains 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

text contains 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

x double

The x-coordinate of the upper-left corner of the drawn text.

y double

The y-coordinate of the upper-left corner of the drawn text.

text string

The string to draw.

options PdfStringDrawingOptions

The 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

text contains 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

text contains a glyph that cannot be drawn using the current Font and cannot be substituted using the options.MissingGlyphHandler.

DrawString(PdfPoint, string)

Draws the specified text string starting from the specified position.

public void DrawString(PdfPoint position, string text)

Parameters

position PdfPoint

A PdfPoint structure that specifies the upper-left corner of the drawn text.

text string

The 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

text contains 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

text contains 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

position PdfPoint

A PdfPoint structure that specifies the upper-left corner of the drawn text.

text string

The string to draw.

options PdfStringDrawingOptions

The 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

text contains 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

text contains a glyph that cannot be drawn using the current Font and cannot be substituted using the options.MissingGlyphHandler.