比如带有根号,分子分母,以及上下标的公式怎么写入word呢?有相关文档啥的吗?
@tahir.manzoor比如带有根号,分子分母,以及上下标的公式怎么写入word呢?有相关文档啥的吗?
您可以使用DocumentBuilder.InsertHtml方法插入MathML,如下所示。 希望对您有帮助。
Document doc = new Document();
DocumentBuilder builder = new DocumentBuilder(doc);
builder.InsertHtml(
"<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>" +
"</math>");
doc.Save(MyDir + "output.docx");
请使用以下代码片段将Shape保存到图像中。 希望对您有帮助。
Document doc = new Document(MyDir + "input.docx");
Shape shape = (Shape)doc.GetChild(NodeType.Shape, 0, true);
shape.GetShapeRenderer().Save(MyDir + "Shape.png", new ImageSaveOptions(SaveFormat.Png));