GroupDocsGists
10/19/2017 - 11:21 AM

SetCustomFontDirectory.cs

// For complete examples and data files, please go to https://github.com/groupdocs-viewer/GroupDocs.Viewer-for-.NET
// Setup GroupDocs.Viewer config
ViewerConfig config = Utilities.GetConfigurations();

// Add custom fonts directories to FontDirectories list
config.FontDirectories.Add(@"/usr/admin/Fonts");
config.FontDirectories.Add(@"/home/admin/Fonts");

ViewerHtmlHandler htmlHandler = new ViewerHtmlHandler(config);

// File guid
string guid = DocumentName;

List<PageHtml> pages = htmlHandler.GetPages(guid);

foreach (PageHtml page in pages)
{
    //Save each page at disk
    Utilities.SaveAsHtml(page.PageNumber + "_" + DocumentName, page.HtmlContent);
}