We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Bad rendering Doc to PDF for Arabic

I’ve noticed a lot of bad rendering when converting docx files to Arabic using the Windows10 Calibri font (and others).

It seems like the marks aren’t getting placed correctly when compared to Word 365 (v1902) or Windows10’s WordPad.

I’m using Aspose.Words for .Net V19.3.0 and not doing anything fancy with the document. Just crating a new Aspose.Words.Document from file and Saving with Document.Save and no other options.

I’ve attached a zip file with the outputs from Word, WordPad, and Aspose along with a test document. I would expect the output of Aspose to be closer to Word or WordPad.

Feel free to ask if you need any more information.

Thanks.Aspose-Error.zip (15.6 KB)

@davyonaspose,

Please make sure that you have installed the latest version of ‘Calibri’ font on the machine you are performing Word to PDF conversion on. We do not observe any issue on our end (see 19.3.pdf (11.6 KB)). The font file used on our end is also attached:
Calibri-Win-10.zip (2.8 MB)

Thanks for the reply. Your 19.3.pdf looks to be using Arial (or Times New Roman) not Calibri. I’m guessing your program was doing a substitution or maybe the test docx wasn’t set correctly?

I tried using your fonts from Colibri-Win-10.zip and got the same bad results. I also tried removing system fonts and set the font folder source to a directory that only contains the Calibri font, to prevent any substitutions.

Here is the code I used to prevent substitutions:

FontSettings fontSettings = new FontSettings();
ArrayList fontSources = new ArrayList();
FolderFontSource folderFontSource = new FolderFontSource(@"c:\temp\fonts", true);
fontSources.Add(folderFontSource);
FontSourceBase[] updatedFontSources = (FontSourceBase[])fontSources.ToArray(typeof(FontSourceBase)); 
doc.FontSettings = new FontSettings();
doc.FontSettings.SetFontsSources(updatedFontSources);

Can you please verify if your test was using Calibri?

Thanks again for your help!

@davyonaspose,

We have logged your problem in our issue tracking system. Your ticket number is WORDSNET-18398. We will further look into the details of this problem and will keep you updated on the status of the linked issue.