Replace missing fonts
In case your presentation document contains a font that is not installed into the system GroupDocs.Viewer will use a default font. GroupDocs.Viewer enables you to specify font substitution with DefaultFontName setting.
Font substitution
To set font substitution for missing fonts please use the following code:
When converting to HTML with embedded resources:
using (Viewer viewer = new Viewer("input.pptx"))
{
HtmlViewOptions viewOptions = HtmlViewOptions.ForEmbeddedResources("output/html_embedded/p_{0}.html");
viewOptions.DefaultFontName = "Times New Roman";
viewer.View(viewOptions);
}
When converting to HTML with external resources:
using (Viewer viewer = new Viewer("input.pptx"))
{
HtmlViewOptions viewOptions = HtmlViewOptions.ForExternalResources("output/html_external");
viewOptions.DefaultFontName = "Times New Roman";
viewer.View(viewOptions);
}
Output HTML with default font:
Output HTML with “Times New Roman” font:
When converting to PDF:
using (Viewer viewer = new Viewer("input.pptx"))
{
PdfViewOptions viewOptions = new PdfViewOptions("output.pdf");
viewOptions.DefaultFontName = "Times New Roman";
viewer.View(viewOptions);
}
Output PDF with default font:
Output PDF with “Times New Roman” font: