How can I take preview of documents?

我的未来我决定 提交于 2019-11-29 10:34:44

问题


I'm working on a file sharing website, I need a way to take screenshots of the uploaded documents.

The site will support several file formarts, from plain text to office documents (doc, xls, ppt, ...), videos (mpeg, avi, ...), images (jpg, gif, png, ...) PDF's, Open Office, etc.

Each document need to have a "preview" of it, the good part is that the client wants the following formats to have previews: doc, xls, ppt and pdf. The other files format are optionals, they'll have preview if I can find a way to take them.

Additionally, the images are not a problem because I just need to include a thumbnail in the preview. Also I will use FFMPEG for converting videos to FLV so I can use it for taking screenshots of the videos too.

I was thinking in using JODconverter which supports Office and Open Office formats, I don't know if it converts to JPG but at least it converts to PDF which is somenthing. The site is being build in PHP under Drupal 5 running in a dedicated Debian server so in case that I choose JOD I'll use it as a webservice running in a virtual server in the same machine.

Does anybody knows a better application or method for converting files to images?

Any help will be greatly appreciated, thanks in advance!

Javier


回答1:


The Windows Thumbnail Viewer is a COM object which implements IExtractImage. Out of the box it supports many file types, and applications can add their own. By relying on that interface, you're more likely to get free support for other document types you might not even have considered today.




回答2:


I ended using JODConverter for converting everything to PDF and then SWFTools for converting from PDF to SWF. I created my own document viewer using Flash.

It's working really well so far.




回答3:


For viewing PDF documents you can make use of the ITextSharp library. Here is the link:

http://itextsharp.sourceforge.net/



来源:https://stackoverflow.com/questions/175528/how-can-i-take-preview-of-documents

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!