Executing the following code results in the arial font in the attached workbook being changed to calibri:
Hi Sarah,
Appears to be fixed in that revision.
Thank you.
Hi Sarah,
I have been experiencing the same issue, but with Cells 17.7 and 18.10. I created a brand new workbook in excel 2016, set the entire sheet to Arial 11 (in Excel, added a line, “testing the font” and saved it).
Then I added the following code in VB.NET
and the resulting PDF comes out as Calibri
Dim strdoc as string = “C:\Test.xlsx”
Dim Savedoc as string = C:\Test.pdf"
dim wb as new aspose.cells.workbook(strdoc)
wb.save(savedoc)
the resulting PDF comes out in Calibri, how do I get it to come out in Arial?
Thanks in advance, Tom
Thanks for your query.
I have tried to reproduce this scenario using latest version Aspose.Cells for .NET 18.11.x, but no issue is observed. Different texts in Arial and Calibri font are rendered in their respective font in the PDF. You may please give it a try using latest version and share the feedback.
You may also try to set the custom font folder for checking your scenario as shown in the below sample code which sets different font folders for the API to use.
// Defining string variables to store paths to font folders & font file
string fontFolder1 = sourceDir + "Arial";
string fontFolder2 = sourceDir + "Calibri";
string fontFile = sourceDir + "Arial.ttf";
// Setting first font folder with SetFontFolder method
// Second parameter directs the API to search the subfolders for font files
FontConfigs.SetFontFolder(fontFolder1, true);
// Setting both font folders with SetFontFolders method
// Second parameter prohibits the API to search the subfolders for font files
FontConfigs.SetFontFolders(new string[] { fontFolder1, fontFolder2 }, false);
// Defining FolderFontSource
FolderFontSource sourceFolder = new FolderFontSource(fontFolder1, false);
// Defining FileFontSource
FileFontSource sourceFile = new FileFontSource(fontFile);
// Defining MemoryFontSource
MemoryFontSource sourceMemory = new MemoryFontSource(System.IO.File.ReadAllBytes(fontFile));
// Setting font sources
FontConfigs.SetFontSources(new FontSourceBase[] { sourceFolder, sourceFile, sourceMemory });