The following code snippet shows how to add a custom font source:
usingGroupDocs.Viewer;usingGroupDocs.Viewer.Options;usingGroupDocs.Viewer.Fonts;// ...// Specify the font source.FolderFontSourcefontSource=newFolderFontSource(@"C:\custom_fonts",SearchOption.TopFolderOnly);FontSettings.SetFontSources(fontSource);using(Viewerviewer=newViewer("sample.docx")){// Create an HTML file.HtmlViewOptionsviewOptions=HtmlViewOptions.ForEmbeddedResources();viewer.View(viewOptions);}
ImportsGroupDocs.ViewerImportsGroupDocs.Viewer.OptionsImportsGroupDocs.Viewer.Fonts' ...
ModuleProgramSubMain(argsAsString())' Specify the font source.
DimfontSourceAsFolderFontSource=NewFolderFontSource("C:\custom_fonts",SearchOption.TopFolderOnly)FontSettings.SetFontSources(fontSource)UsingviewerAsViewer=NewViewer("sample.docx")' Create an HTML file.
DimviewOptionsAsHtmlViewOptions=HtmlViewOptions.ForEmbeddedResources()viewer.View(viewOptions)EndUsingEndSubEndModule
Was this page helpful?
Any additional feedback you'd like to share with us?
Please tell us how we can improve this page.
Thank you for your feedback!
We value your opinion. Your feedback will help us improve our documentation.