Load custom fonts.

On this page

GroupDocs.Annotation v21.5 and later allows you to generate preview for documents using custom fonts. To do this, specify the FontDirectories property of the LoadOptions class.

The following code snippet shows how to use custom fonts while generating preview:

using (Annotator annotator = new Annotator(fs, new LoadOptions { FontDirectories = new List<string> { $"D:/fonts" } }))
{
    PreviewOptions previewOptions = new PreviewOptions(pageNumber =>
    {
        var pagePath = $"D:/result_{pageNumber}.png";
        return File.Create(pagePath);
    });

    annotator.Document.GeneratePreview(previewOptions);
}

On this page