Some Equations Missing DOCX to PDF

I have some word documents with formulas created using the built in word equation editor. When I convert them to PDF the formula is missing.

I am using this code to save the word document as a PDF

var doc = new Document("TestFormula.docx");
doc.UpdatePageLayout();
doc.AcceptAllRevisions();
doc.Save("TestFormula.pdf", SaveFormat.Pdf);

OS: Windows
Library: Aspose.Words 22.1.0
Language: C# .NET5

This is the file in question:
TestFormula.docx (13.5 KB)

@TimothyBlue Thank you for reporting this problem to us. I have logged it as WORDSNET-23316. We will keep you informed and let you know once it is resolved.

It has been almost 9 months since this was reported. Is there any ETA on a resolution?

@TimothyBlue Unfortunately, the issue is not resolved yet. We have completed analysis of this issue. The problematic document contains OfficeMath object, version 3.0. This object is not editable in MS Word latest versions, instead MS Word proposes to convert it to OfficeMathML. There are no problems with rendering in case of converting and resaving this document.
The issue is in the case which is currently not processed by Aspose.Words.
OfficeMath 3.0 node contains a reference to OleObject stored as a document part and a reference to VML Shape as a fallback part.
Aspose.Words currently handles such nodes correctly only if they occur directly in a Paragraph. However, as the problematic document shows, it can be OfficeMath node child.

Model expected by Aspose.Words:

<w:p>
  <m:r>
    <w:object>
      <o:OLEObject/>
      <v:shape/>
    </w:object>
  <m:r/>
<w:p/>

Problematic document model:

<w:p>
  <m:oMathPara>
    <m:oMath>
      <m:r>
        <w:object>
          <o:OLEObject/>
          <v:shape/>
        </w:object>
      <m:r/>
    <m:oMath/>
  <m:oMathPara/>
<w:p/>

When resaving without converting OfficeMath 3.0, this structure is preserved, which means that MS Word considers it valid structure.

The issue is not yet scheduled for development, so currently we cannot provide you an estimate.

Thank you so much for that info. We converted the equations that were not working to the latest version and that solved the problem for us.

1 Like