How to read word math equation

How to read word math equation and save in db from word document.

In interop, I can get the math equation by using this code

//detect and get word math equation function from word file 

 public string Mathequation1(Paragraph para = null)
        {
            string eqtxt = "";
            if (para.Range.OMaths.Count > 0)
                {
                    if (para.Range.InlineShapes.Count > 0)
                    {
                        InlineShape currentShape = para.Range.InlineShapes[1];
                        if (currentShape.Field.Code.Text.Trim().ToLower().Contains("equation"))
                        {
                            return "";
                        }
                    }
                    ////equation handling convert to linearize                            
                    var DelimeterText = new StringBuilder();
                    List<string> eqtext = new List<string>();
                    int starti = 1;
                    string streq = "";
                    int eqcounter = 1;
                    Range r2 = para.Range;
                    foreach (OMath eq in r2.OMaths)
                    {
                        if (!para.Range.Text.Contains(eq.Range.Text))
                        {
                            return "";
                        }
                                          
                        eq.Linearize();
                        streq = eq.Range.Text ;
                        //streq = EquationParser(streq);  //call equation parser 
                        eqtext.Add(streq);                                        
                        eq.Range.Text = "eq" + eqcounter;
                        eqcounter++;
                        eq.Remove();
                    }

                    //equation
                    eqtxt = r2.Text;

                    for (int i = 1; i < eqcounter; i++)
                    {
                        eqtxt = eqtxt.Replace("eq" + i, eqtext[i - 1]);
                    }
                    return eqtxt;

                }}

How Can I Get the Equation in Docio


Attachment: Math_Equation_Sample_18e148f8.zip

2 Replies

DB Dilli Babu Nandha Gopal Syncfusion Team September 7, 2018 07:10 AM UTC

Hi Irshad, 

Thank you for contacting Syncfusion support. 

We regret to let you know that the support for creating and accessing/manipulating a  EquationML(MathML) is not yet implemented and we have already logged this as a feature request in our database. We will implement this feature in any of our upcoming releases. The feature implementation would also greatly depend on the factors such as product design, code compatibility and complexity. We request you to visit our website periodically for feature related updates. 

Regards, 
Dilli babu. 



MJ Mohanaselvam Jothi Syncfusion Team December 18, 2019 10:25 AM UTC

Hi Irshad,

We are glad to announce that our Essential Studio 2019 Volume 4 Release v17.4.0.39 is rolled out which includes the feature with " Support for mathematical equations (MathML) in Word documents (DOCX and WordML formats)" and it is available for download under the following link.
https://www.syncfusion.com/forums/150001/essential-studio-2019-volume-4-release-v17-4-0-39-is-available-for-download

Please find the release notes details from the following link:
https://help.syncfusion.com/aspnet/release-notes/v17.4.0.39?type=all#docio

Please find the UG documentation link to know more about working with mathematical equation:
Working with Mathematical Equation

We thank you for your support and appreciate your patience in waiting for this release. Please get in touch with us if you would require any further assistance.

Regards,
Mohanaselvam J


Loader.
Up arrow icon