Docotic.Pdf Library Help > BitMiracle.Docotic.Pdf > PdfDocument Class > PdfDocument Methods > AddFontFromFile Method > AddFontFromFile Method (String, Boolean, Boolean, Boolean, Boolean)
Creates a new font with specified properties using provided font file and adds the new font to the end of the collection of document fonts.

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

Syntax

C#
public PdfFont AddFontFromFile(
	string fileName,
	bool bold,
	bool italic,
	bool underline,
	bool strikeout
)
VB
Public Function AddFontFromFile ( 
	fileName As String,
	bold As Boolean,
	italic As Boolean,
	underline As Boolean,
	strikeout As Boolean
) As PdfFont

Parameters

fileName
Type: System.String
The name of the font file.
bold
Type: System.Boolean
if set to true then added font will be bold.
italic
Type: System.Boolean
if set to true then added font will be italic.
underline
Type: System.Boolean
if set to true then text drawn with added font will be underlined.
strikeout
Type: System.Boolean
if set to true then text drawn with added font will be stroked out.

Return Value

Type: PdfFont
The newly added PdfFont.

Remarks

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

Only TrueType and Type1 font files are supported by this method.

See Also