Aspose.Words是一款功能强大的Word处理控件,不需要安装Office的情况下,可以对word文档进行浏览,修改,保存,转换,支持DOC, DOT, DOCM, DOTM, DOCX, DOTX等格式,支持转换为word文档为 PDF, XPS, XamlFixed, XamlFlow, XamlFlowPack, EPUB, HTML, HtmlFixed, OpenXPS, PostScript, TXT 等,和 TIFF, JPG, PNG, BMP, SVG, EMF, SVG , SWF等图像文件.
如何使用Aspose.Words如何保存为多页PNG图片:
string wordPath = "D:\\DemoTest\\Test1.doc";
Document doc = new Document(wordPath);
// Save each page of the document to image.
for (int pageIndex = 0; pageIndex < doc.PageCount; pageIndex++)
{
ImageSaveOptions opt = new ImageSaveOptions(SaveFormat.Png);
opt.PageIndex = pageIndex;
opt.PageCount = 1;
doc.Save(string.Format(@"out_{0}.png", pageIndex), opt);
}