C#/ ASP.NET - 获取从PDF / DOC文件的缩略图 [英] C#/ASP.NET - Get thumbnail from PDF/DOC files
问题描述
我有一个ASP.NET应用程序的WebForms(C#编写),允许用户使用FileUpload控件上传文件。
I have an ASP.NET WebForms application (written in C#) that allows users to upload files using the FileUpload control.
什么了是巨大的,如果我能自动生成文件的缩略图。图片,如JPG / PNG是微不足道的,当然,但用户会经常上传.doc和.PDF文件 - ?有没有一种方法可以让我.doc和.PDF文件本质上转换成图像,以便我能得到一个缩略图
What'd be great is if I could automatically generate thumbnails from files. Images such as JPG/PNG are trivial of course, but users will often upload .DOC and .PDF files - is there a way I can essentially convert .DOC and .PDF files to images so I can get a thumbnail?
谢谢!
推荐答案
对于PDF你可以从websupergoo尝试ABCPDF。这样,您应该能够生成缩略图,
文档链接从PDF创建PNG。 http://www.websupergoo.com/helppdf8net/source/4 -examples / 19 rendering.htm
For PDf you can try ABCPDF from websupergoo. With that you should be able to generate a thumbnail, Documentation link for creating a PNG from a PDF. http://www.websupergoo.com/helppdf8net/source/4-examples/19-rendering.htm
也是医生,这是一个有点复杂,你将必须安装托管应用程序,并从那里操作图像服务器上的Office应用程序。
also for Doc, it is a little more complex, you are going to have to install the office application on the server that host the apps and from there manipulate the image.
看一下这篇文章。它可以让你提取缩略图Windows资源管理器使用Office文档和定期的图像。
http://msdn.microsoft.com/en-us/library/aa289172.aspx
Look at this article. It lets you extract the thumbnail image that Windows Explorer uses for Office documents and regular images. http://msdn.microsoft.com/en-us/library/aa289172.aspx
这篇关于C#/ ASP.NET - 获取从PDF / DOC文件的缩略图的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!