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)


public static PdfFont AddFont(
	this PdfDocument doc,
	string fontFace,
	FontStyle fontStyle
Public Shared Function AddFont ( 
	doc As PdfDocument,
	fontFace As String,
	fontStyle As FontStyle
) As PdfFont


Type: BitMiracle.Docotic.Pdf.PdfDocument
The document.
Type: System.String
The name of the font face.
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).


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

See Also