PdfDocumentGdiExtensions.AddFont Method (PdfDocument, String, FontStyle)

Adds the new font with specified properties to the end of the collection of document fonts.

Namespace:  BitMiracle.Docotic.Pdf.Gdi
Assembly:  BitMiracle.Docotic.Pdf.Gdi (in BitMiracle.Docotic.Pdf.Gdi.dll)

Syntax

C#
public static PdfFont AddFont(
	this PdfDocument doc,
	string fontFace,
	FontStyle fontStyle
)
VB
<ExtensionAttribute>
Public Shared Function AddFont ( 
	doc As PdfDocument,
	fontFace As String,
	fontStyle As FontStyle
) As PdfFont

Parameters

doc
Type: BitMiracle.Docotic.Pdf.PdfDocument
The document.
fontFace
Type: System.String
The name of the font face.
fontStyle
Type: System.Drawing.FontStyle
The FontStyle of the new font.

Return Value

Type: PdfFont
The newly added PdfFont or null if there is no font with specified face installed.

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type PdfDocument. When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).

Remarks

If requested font does not have bold or italic version then bold or italic version will be synthesized when needed.

See Also