TextObjectSetFont Method (String, Double)

Apitron PDF Kit help
Apitron.PDF.Kit library for .NET
Sets the current font.

Namespace:  Apitron.PDF.Kit.FixedLayout.Content
Assembly:  Apitron.PDF.Kit (in Apitron.PDF.Kit.dll) Version: 2.0.37.0 (2.0.37.0)
Syntax

public void SetFont(
	string fontResourceID,
	double fontSize
)

Parameters

fontResourceID
Type: SystemString
The font resource ID or the font name or path to the font file.
fontSize
Type: SystemDouble
Size of the font.
Remarks

Examples

C#
// create text object based on standard fonts
TextObject text = new TextObject(StandardFonts.Helvetica, 16);
text.SetTextMatrix(1, 0, 0, 1, 80, 700);
text.AppendTextLine("celebrate");
page.Content.AppendText(text);
text.SetTextMatrix(1, 0, 0, 1, 80, 670);

// set font
text.SetFont(StandardFonts.TimesBoldItalic, 16);
text.AppendTextLine("fanciful");
page.Content.AppendText(text);
text.SetTextMatrix(1, 0, 0, 1, 80, 640);

// set font
text.SetFont(StandardFonts.CourierBoldOblique, 16);
text.AppendTextLine("groovy");
page.Content.AppendText(text);
document.Pages[0].Content.AppendText(text);
See Also

Reference