When I try to convert a word document to pdf that contains symbols the result pdf is like Attacment1.png. I use bellow code to do this conversion:
var document = new Aspose.Words.Document(sourceFilePath);
var saveOption = new Aspose.Words.Saving.PdfSaveOptions();
saveOption.NumeralFormat = Aspose.Words.Saving.NumeralFormat.Context;
var fontSettings = FontSettings.DefaultInstance;
foreach (FontInfo fontInfo in document.FontInfos)
fontSettings.SetFontSubstitutes(fontInfo.Name, fontSettings.DefaultFontName);
document.FontSettings = fontSettings;
saveOption.FontEmbeddingMode = Aspose.Words.Saving.PdfFontEmbeddingMode.EmbedNonstandard;
document.Save(resultFilePath, saveOption);
I attached sample document and used font.
Hi Freydoon,
Thanks for your
inquiry. We have tested the
scenario and have not managed to reproduce the same issue at our side. I
have attached the output generated from the above code snippet, using the latest version of Aspose.Words for .NET.
For more information please
visit Font
Availability and Substitution & True Type
Fonts. If you still face any problem, please let
us know we will try to help you as much we can. Thanks.
You're right, I forgot to add default font to the source font folder.
Thanks
Hi Freydoon,
I am glad it fixes your issue. If you face any issue regarding Aspose.Words, please let us know we will try to help you as much we can. Thanks.
Hi again
My problem is resolved in the current version of my application, but my clients used an older version of my application and it use Aspose.Words version 15.6.0.0, I can't update those to last version of Aspose.Words, they have the above problem and I set font substitution like below code, but it's not work.
var document = new Aspose.Words.Document(sourceFilePath);
foreach (FontInfo fontInfo in document.FontInfos)
FontSettings.AddFontSubstitutes(fontInfo.Name, FontSettings.DefaultFontName);
var saveOption = new Aspose.Words.Saving.PdfSaveOptions();
saveOption.NumeralFormat = Aspose.Words.Saving.NumeralFormat.Context;
document.Save(resultFilePath, saveOption);
In this version of Aspose.Words I can't set document's FontSetting and all document use global FontSettings.
I attached a new document and font that have this problem in this version of Aspose.Words.
It seems the problem is font fallback. I used system font folder and Arial Unicode MS is installed. Is there any way to resolve this problem without update clients?
Thanks for the prompt reply