Embedded Excel Object in Word to pdf with Farsi words

I have a word document written in Farsi which has an Embedded Excel Object which is a table copied from an excel and pasted as picture in this document. When I convert it to PDF all the characters in this table get messed up. This problem didn’t exist in the old version we were using but when we updated to version 25.4 it appeared. I even test the word to pdf conversion using aspose online tooling to make sure.
I attached the resulting converted pdf and the source word document (as a zip file).
I used this code for conversion:

var doc = new Aspose.Words.Document(SRC);
doc.Save(dest);

New Microsoft Word Document (2).zip (12.3 KB)

New Microsoft Word Document (2).pdf (16.7 KB)

@salehimohammadjavad332 To get the output closer to MS Word it is required to enable open type features. Aspose.Words.Shaping.Harfbuzz package provides support for OpenType features in Aspose.Words using the HarfBuzz text shaping engine. You should enabling open type features to get the expected result. To achieve this you should add reference to Aspose.Words Shaping Harfbuzz plugin and use the following code to convert your document:

Document doc = new Document(@"C:\Temp\in.docx");
doc.LayoutOptions.TextShaperFactory = Aspose.Words.Shaping.HarfBuzz.HarfBuzzTextShaperFactory.Instance;
doc.Save(@"C:\Temp\out_HarfBuzz.pdf");

out_HarfBuzz.pdf (18.3 KB)

thanks. This worked.

1 Like