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

Free Support Forum - aspose.com

How to insert Math type equations or equations in WMF file format in DOCX using .NET

Hello Team,

I want to insert Mathtype equations or equations in wmf file format in word document using Aspose.Net.
Doc1 (2).zip (13.3 KB)

Can you please share sample example for this.
Attached sample document which contains Mathtype equations.



You can insert math equation image using DocumentBuilder.InsertImage method. It will insert as image into document. However, you can insert MathML using DocumentBuilder.InsertHtml method as shown below. Hope this helps you.

Document doc = new Document();
DocumentBuilder builder = new DocumentBuilder(doc);
    "<math xmlns = \"http://www.w3.org/1998/Math/MathML\">" +
    "<mfrac>" +
    "<msup>" +
    "<mn>5</mn>" +
    "<mfrac bevelled=\"true\">" +
    "<mn>6</mn>" +
    "<mn>7</mn>" +
    "</mfrac>" +
    "</msup>" +
    "<mn>8</mn>" +
    "</mfrac>" +

doc.Save(MyDir + "20.5.docx");

Thanks for the response.
I have Mathtype equations in wmf files and want to embed it in word. After inserting it into word equation should be open in mathtype application after clicking on it.
Here I attached sample mathtype equation in wmf file. This wmf file I want to insert it into word file.image1.zip (1.7 KB)


Please note that Aspose.Words mimics the behavior of MS Word. if you insert the WMF into Word document using MS Word, you will get the same output. This is because Windows Metafile is an image file format.