这个问题在这里已有答案:
使用C# 2答案 将Word文件页面转换为jpg图像我有一些doc或docx文件。如果我将doc文件上传到服务器,我想自动将它们转换为图像。 有没有人有解决方案来解决这个问题? 最终目标就是这样。 http://www.liuyang.gov.cn/lyswszf/rdzt/15762/content_114176.html谢谢。
This question already has an answer here:
Convert Word file pages to jpg images using C# 2 answersI have some doc or docx files.I want to convert them to images automatically if I upload doc files to server. Does anyone have solutions to solve this problem? the final target is just like this. http://www.liuyang.gov.cn/lyswszf/rdzt/15762/content_114176.html thanks .
最满意答案
使用第三方组件:Aspose.Words,它可以为您完成。
Document doc = new Document(MyDir + "Document.doc"); doc.Save(MyDir + "Document.ConvertToHtml Out.html", SaveFormat.Html);它还支持保存到Png格式。
SaveFormat.Png:呈现文档的页面并将其另存为PNG文件。
use a third party component: Aspose.Words, it can do it for you.
Document doc = new Document(MyDir + "Document.doc"); doc.Save(MyDir + "Document.ConvertToHtml Out.html", SaveFormat.Html);it also support save to Png format.
SaveFormat.Png: Renders a page of the document and saves it as a PNG file.
更多推荐
发布评论