gpt4 book ai didi

c# - 将 xml 文件转换为 .doc 或 .ppt

转载 作者:太空宇宙 更新时间:2023-11-03 16:38:24 25 4
gpt4 key购买 nike

我有一些 xml 文件,我必须通过格式化将其动态转换为 doc 文件。什么是最好的方法? xml 是以下类型

What does that mean?</RichText><RichText><Emph>MIKE</Emph>
Look at this... (<Italic>he points, triumphantly</Italic>) Rust.</RichText><RichText><Emph>MRS. MENDEZ</Emph> (<Italic>looking</Italic>)
Looks like dirt to me.</RichText><RichText><Emph>MIKE </Emph>(<Italic>nose in computer, tapping</Italic>)

最佳答案

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Spire.Doc;

namespace Xml2Pdf
{
class Program
{
static void Main(string[] args)
{
Document doc = new Document();
doc.LoadFromFile("sample.xml", FileFormat.Xml);
doc.SaveToFile("test.doc", FileFormat.Doc);
}
}
}

关于c# - 将 xml 文件转换为 .doc 或 .ppt,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8454781/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com