Document.TextStyleWithFont Method (Stream, Nullable(FontEmbedMode))

Docotic.Pdf library help > BitMiracle.Docotic.Pdf.Layout > Document Class > Document Methods > TextStyleWithFont Method > TextStyleWithFont Method (Stream, Nullable(FontEmbedMode))
Creates a text style based on a font from stream.

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

Syntax

C#
public TextStyle TextStyleWithFont(
	Stream stream,
	FontEmbedMode? embedMode = null
)
VB
Public Function TextStyleWithFont ( 
	stream As Stream,
	Optional embedMode As FontEmbedMode? = Nothing
) As TextStyle

Parameters

stream
Type: System.IO.Stream
The font stream.
embedMode (Optional)
Type: System.Nullable<FontEmbedMode>
The preferred font embed mode. Can be null.

Return Value

Type: TextStyle
The text style associated with the font.

Exceptions

ExceptionCondition
ArgumentNullExceptionstream is null.

Remarks

Caller of the method is responsible for disposing of the stream.

When embedMode is null the library embeds used glyphs for TrueType/OpenType fonts, does not embed built-in PDF fonts, and embeds all glyphs for Type1 and CFF fonts.

See Also