FontEmbedder

Overview

FontEmbedder is a class in Aspose.PDF FOSS for .NET.

Embeds TrueType fonts into PDF documents for custom text rendering.

This class provides 5 methods for working with FontEmbedder objects in .NET programs. Available methods include: AddToPage, Embed, EmbedFromFile, EmbedSubset, EmbedSubsetFromFile. All public members are accessible to any .NET application after installing the Aspose.PDF FOSS for .NET package. Properties: PostScriptName, ResourceName.

Properties

NameTypeAccessDescription
ResourceNamestringReadThe resource name to use in content streams (e.g., “F1”).
PostScriptNamestringReadThe PostScript name of the embedded font.

Methods

SignatureDescription
Embed(document: Document, ttfData: byte[], resourceName: string)Embed a TrueType font from file bytes into a document.
EmbedFromFile(document: Document, path: string, resourceName: string)Embed a TrueType font from a file path.
EmbedSubset(document: Document, ttfData: byte[], text: string, resourceName: string)Embed a subset of a TrueType font containing only the glyphs needed for the given text.
EmbedSubsetFromFile(document: Document, path: string, text: string, resourceName: string)Embed a subset of a TrueType font from a file path.
AddToPage(page: Page)Add the font resource to a page’s resource dictionary.

See Also