Thread ID: |
Created: |
Updated: |
Platform: |
Replies: |
141856 | Jan 8,2019 11:08 AM UTC | Jan 10,2019 05:00 PM UTC | ASP.NET Core - EJ 2 | 3 |
![]() |
Tags: DocIO |
wordDocument.FontSettings.SubstituteFont += (sender, eventArgs) =>
{
// Sets the alternate font when a specified font is not installed in the production environment.
if (eventArgs.OriginalFontName == "Arial")
{
FileStream template = new FileStream(@"Arial.ttf", FileMode.Open, FileAccess.Read, FileShare.ReadWrite);
eventArgs.AlternateFontStream = template;
}
else if (eventArgs.OriginalFontName == "Calibri")
{
FileStream template = new FileStream(@"Calibri.ttf", FileMode.Open, FileAccess.Read, FileShare.ReadWrite);
eventArgs.AlternateFontStream = template;
}
else if(eventArgs.OriginalFontName == "Arial Unicode MS")
{
FileStream template = new FileStream(@"ARIALUNI.TTF", FileMode.Open, FileAccess.Read, FileShare.ReadWrite);
eventArgs.AlternateFontStream = template;
}
}; |
This post will be permanently deleted. Are you sure you want to continue?
Sorry, An error occured while processing your request. Please try again later.
This page will automatically be redirected to the sign-in page in 10 seconds.