[]
        
(Showing Draft Content)

C1.Xaml.Pdf.C1PdfDocument.DrawString

DrawString Method

DrawString(string, Font, Brush, Rect, int, StringFormat)

Draws the specified text string in the specified rectangle with the specified Brush and C1.Util.Font objects using the formatting attributes of the specified C1.Util.StringFormat object.

Declaration
public int DrawString(string text, Font font, Brush brush, Rect rc, int firstChar, StringFormat sf)
Public Function DrawString(text As String, font As Font, brush As Brush, rc As Rect, firstChar As Integer, sf As StringFormat) As Integer
Parameters
Type Name Description
string text

String to draw.

Font font

C1.Util.Font object that defines the appearance and size of the drawn text.

Brush brush

Brush object that defines the color of the drawn text.

Rect rc

The rectangle structure that specifies the location of the drawn text, in points from the top left corner of the page.

int firstChar

Index of the first character that will be rendered.

StringFormat sf

C1.Util.StringFormat object that specifies formatting attributes applied to the drawn text.

Returns
Type Description
int

DrawString(string, Font, Color, Rect, int, StringFormat)

Draws the specified text string in the specified rectangle with the specified Brush and C1.Util.Font objects using the formatting attributes of the specified C1.Util.StringFormat object.

Declaration
public int DrawString(string text, Font font, Color color, Rect rc, int firstChar, StringFormat sf)
Public Function DrawString(text As String, font As Font, color As Color, rc As Rect, firstChar As Integer, sf As StringFormat) As Integer
Parameters
Type Name Description
string text

String to draw.

Font font

C1.Util.Font object that defines the appearance and size of the drawn text.

Color color

The color of the drawn text.

Rect rc

The rectangle structure that specifies the location of the drawn text, in points from the top left corner of the page.

int firstChar

Index of the first character that will be rendered.

StringFormat sf

C1.Util.StringFormat object that specifies formatting attributes applied to the drawn text.

Returns
Type Description
int

The index of first character that was not printed because it did not fit in the specified rectangle.

DrawString(string, Font, Brush, Rect, int, StringFormat, float)

Draws the specified text string in the specified rectangle, with the specified Brush and C1.Util.Font, using the formatting attributes of the specified C1.Util.StringFormat object and specified character width coefficient.

Declaration
public int DrawString(string text, Font font, Brush brush, Rect rc, int firstChar, StringFormat sf, float widthCoeff)
Public Function DrawString(text As String, font As Font, brush As Brush, rc As Rect, firstChar As Integer, sf As StringFormat, widthCoeff As Single) As Integer
Parameters
Type Name Description
string text

The string to draw.

Font font

The C1.Util.Font used to draw the text.

Brush brush

The Brush specifying the text color.

Rect rc

The rectangle specifying the location of the text, in points from the top left corner of the page.

int firstChar

The index of the first character that will be rendered.

StringFormat sf

The C1.Util.StringFormat object specifying the formatting attributes applied to the text.

float widthCoeff

The width coefficient applied to characters. The default is 1.0, use 2.0 for double width and so on.

Returns
Type Description
int

The index of the first character that was not rendered because it did not fit in the specified rectangle.

DrawString(string, Font, Color, Rect, int, StringFormat, float)

Draws the specified text string in the specified rectangle, with the specified Brush and C1.Util.Font, using the formatting attributes of the specified C1.Util.StringFormat object and specified character width coefficient.

Declaration
public int DrawString(string text, Font font, Color color, Rect rc, int firstChar, StringFormat sf, float widthCoeff)
Public Function DrawString(text As String, font As Font, color As Color, rc As Rect, firstChar As Integer, sf As StringFormat, widthCoeff As Single) As Integer
Parameters
Type Name Description
string text

The string to draw.

Font font

The C1.Util.Font used to draw the text.

Color color

The text color.

Rect rc

The rectangle specifying the location of the text, in points from the top left corner of the page.

int firstChar

The index of the first character that will be rendered.

StringFormat sf

The C1.Util.StringFormat object specifying the formatting attributes applied to the text.

float widthCoeff

The width coefficient applied to characters. The default is 1.0, use 2.0 for double width and so on.

Returns
Type Description
int

The index of the first character that was not rendered because it did not fit in the specified rectangle.

DrawString(TextBlock, Rect)

Draws a string into the specified System.Windows.Rect.

Declaration
public void DrawString(TextBlock tb, Rect rc)
Public Sub DrawString(tb As TextBlock, rc As Rect)
Parameters
Type Name Description
TextBlock tb

TextBlock that contains the text and formatting options.

Rect rc

System.Windows.Rect that specifies the size and position of the text, in points.