文档半岛外围网上直营>>Aspose中文文档>>在 NPOI 中将 Word 文档转换为其他格式
在 NPOI 中将 Word 文档转换为其他格式
Aspose.Words是一种高级Word文档处理API,用于执行各种文档管理和操作任务。API支持生成,修改,转换,呈现和打印文档,而无需在跨平台应用程序中直接使用Microsoft Word。
Aspose API支持流行文件格式处理,并允许将各类文档导出或转换为固定布局文件格式和最常用的图像/多媒体格式。
可以使用“File”菜单中的“Save As”选项将文档转换为其他格式。Aspose.Words 允许将 Word 文档导出或转换为 PDF、XPS、XamlFixed、XamlFlow、XamlFlowPack、EPUB、HTML、HtmlFixed、OpenXPS、PostScript、TXT 和流行的图像/多媒体文件格式,包括 TIFF、JPG、PNG、BMP、SVG、SVG和SWF。
Aspose.Words
使用默认选项将整个文档从 DOC 转换为其他格式。
Document wordDocument = new Document("Convert Word Doc to Other Formats.doc");
wordDocument.Save("data/Convert Word Doc to Other Formatsblank.docx", SaveFormat.Docx);
wordDocument.Save("data/Convert Word Doc to Other Formatsblank.bmp", SaveFormat.Bmp);
wordDocument.Save("data/Convert Word Doc to Other Formatsblank.html", SaveFormat.Html);
wordDocument.Save("data/Convert Word Doc to Other Formatsblank.pdf", SaveFormat.Pdf);
wordDocument.Save("data/Convert Word Doc to Other Formatsblank.text", SaveFormat.Text);
点击复制
NPOI
XWPFDocument wordDocument = new XWPFDocument( new FileStream("Convert Word Doc to Other Formats.doc", FileMode.Open));
using (FileStream sw = File.Create("data/Convert Word Doc to Other Formatsblank.docx"))
{
wordDocument.Write(sw);
}
点击复制
下载运行代码
下载示例代码

QQ交谈
在线咨询

渝公网安备
50010702500608号

客服热线