Search Results for

    Show / Hide Table of Contents

    Class PdfFontCollection

    Observable collection of fonts

    Inheritance
    System.Object
    PdfFontCollection
    Namespace: IronPdf.Fonts
    Assembly: IronPdf.dll
    Syntax
    public class PdfFontCollection : ObservableCollection<PdfFont>

    PdfFontCollection is the object IronPDF C# code works with for PDF fonts. It represents observable collection of fonts.

    PdfFontCollection matters when an application needs to configure or invoke PDF fonts from C# code. The class encapsulates the related options and behavior in a single object that is set up once and reused across render or processing calls. Typical scenarios include batch generation pipelines, templated document workflows, and integration with existing C# document services.

    To use PdfFontCollection, instantiate or obtain it from the relevant entry point in the IronPDF C# API. Key properties include Item[String]. Assign options or invoke methods on the instance to configure or perform the operation. The manage fonts covers typical usage in C# end to end.

    using IronPdf;
    
    // Obtain PdfFontCollection from the relevant entry point in the IronPDF API
    void Configure(PdfFontCollection instance)
    {
        var current = instance.Item[String];
        instance.Add();
    }

    For the broader workflow, see the IronPDF C# documentation for related how-to guides and examples. For broader context, the PDF fonts portion of the IronPDF C# API contains related types that work with PdfFontCollection directly. PdfFontCollection instances inherit additional members from ObservableCollection<PdfFont> that may be relevant in advanced scenarios. In application code, treat PdfFontCollection as a configured object that is constructed once and reused across operations rather than instantiated per call. Configuration is generally idempotent: assigning the same property value twice has the same effect as assigning it once. For diagnostic purposes, inspect the relevant PdfFontCollection property after each operation to confirm the configured state. See the constructors, properties, and methods tables below for the complete API surface of PdfFontCollection. Application code typically obtains or instantiates a single PdfFontCollection and shares it across multiple IronPDF operations rather than recreating it per call.

    Properties

    Item[String]

    Find the first font with the specified font name

    Declaration
    public PdfFont this[string name] { get; }
    Parameters
    Type Name Description
    System.String name

    Font name

    Property Value
    Type Description
    PdfFont

    Font with the specified name

    Methods

    Add(Byte[])

    Add a custom font by file

    Declaration
    public PdfFont Add(byte[] Data)
    Parameters
    Type Name Description
    System.Byte[] Data

    Font data

    Returns
    Type Description
    PdfFont

    Add(String)

    Add a standard font by name

    Declaration
    public PdfFont Add(string Name)
    Parameters
    Type Name Description
    System.String Name

    Standard font name

    Returns
    Type Description
    PdfFont

    Find(String, Boolean)

    Find the first font with the specified font name

    Declaration
    public PdfFont Find(string name, bool skipSubsetFonts = false)
    Parameters
    Type Name Description
    System.String name

    Font name

    System.Boolean skipSubsetFonts

    Optional. Defaults to false. When true, subset fonts are excluded from the search

    Returns
    Type Description
    PdfFont

    Font with the specified name

    GetHashCode()

    Declaration
    public override int GetHashCode()
    Returns
    Type Description
    System.Int32
    ☀
    ☾
    Downloads
    • Download with Nuget
    • Start for Free
    In This Article
    Back to top
    Install with Nuget