Formula in Doc file corrupted when opening with LibreOffice

Hi,

When using Aspose Word to load and save some files, I found that there is a problem with formula inside it. I create a sample DOC test file, use Aspose Word to load and save it, then the output formula inside the file that opened with LibreOffice is corrupted.

Sample code:
string inputFile = “D:\Untitled 1.doc”;
FileStream inStream = new FileStream(inputFile , FileMode.Open, FileAccess.Read, FileShare.ReadWrite);
Aspose.Words.Document doc = new Aspose.Words.Document(inStream);
doc.save(“D:\Untitled 1_out.doc”, SaveFormat.Doc);

Here is the screenshot: image.png (33.7 KB) and sample file: sample.zip (6.0 KB)

I’ve tested with lastest Aspose Word 19.2 but the issue still there.

Please help,

Thanks,
Dung H. Nguyen

@dunghnguyen,

We have converted your “Untitled 1.doc” document to DOC format (see awjava-19.2.zip (3.3 KB)) by using the latest version of Aspose.Words for Java i.e. 19.2 on our end. Do you still see the same problem with this “awjava-19.2.doc” on your end? If not, then please upgrade to the latest version. Hope, this helps.

Upgrade to latest version of Aspose.Words for Java

Hi @awais.hafeez,

I’m using Aspose Word .NET. And in my side, the output of your file in LibreOffice is the same as mine. Can you please check it? image.png (15.2 KB)

Version of LibreOffice: 6.2.0.3 and I downloaded it from: https://www.libreoffice.org

Can you recheck it again?

Thanks

@dunghnguyen,

Thanks for the additional information. We tested the scenario and have managed to reproduce the problem on our end. For the sake of correction, we have logged this problem in our issue tracking system. The ID of this issue is WORDSNET-18168. We will further look into the details of this problem and will keep you updated on the status of correction. We apologize for your inconvenience.

Hi,

Is there any good news for this issue?

Thanks you,

Dung H. Nguyen

@dunghnguyen,

The problem occurs because LibreOffice cannot read the unzipped .emf. It seems that LibreOffice always recognizes only archived metafiles. And Aspose.Words allows to archive only large metafiles (more than 16384 bytes) to optimize speed. We will most likely provide a new save option for DOC format to control this optimization. We will inform you via this thread as soon as this issue is resolved. We apologize for any inconvenience.

Hi @awais.hafeez,

Is there any good news on this ticket? This issue is blocking some features of our product…

Thanks you

@dunghnguyen,

We have good news for you i.e. WORDSNET-18168 has now been resolved. The fix of this issue will be included in the 19.6 (next version) of Aspose.Words. We will inform you via this thread as soon as the next version containing the fix of your issue will be released in next few days.

The issues you have found earlier (filed as WORDSNET-18168) have been fixed in this Aspose.Words for .NET 19.6 update and this Aspose.Words for Java 19.6 update.