在C#中为.doc,.xls,.pdf等创建图片缩略图 [英] Create image-Thumbnails for .doc, .xls, .pdf etc. in C#

查看:174
本文介绍了在C#中为.doc,.xls,.pdf等创建图片缩略图的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有人知道如何显示.doc文件中的图像吗?像页面的小预览一样?

非常感谢!

Does anyone know how to display an image from a .doc file? Like a little preview of a page?

Thanks a lot!

推荐答案

这里是一个乏味的解决方案.

1. 下载 [ ^ ] IECapt. (请阅读文档,以了解如何使用它)

2.创建一个网页,您在其中传递文档路径作为查询字符串,它将显示该文档. (您需要使用办公自动化来显示doc/xls文件)

3.现在,使用您的网页调用IECapt exe(使用System.Diagnostics.Process类).并将URL传递到先前创建的带有特定文档路径的页面作为查询字符串.

4.这会将网页图像存储在指定的文件夹中.

5.现在读取该图像并显示为缩略图.

我知道这是一个麻烦的解决方案,但是所有其他简单方法都不是免费的,除非您想购买这些控件.

:)
Here is one tedious solution.

1. Download[^] IECapt. (please read the document, to see how to use this)

2. Create a webpage where you pass document path, as a query string and it will display that document. (you need to use office automation to show doc / xls file)

3. now call the IECapt exe (using System.Diagnostics.Process class), using your webpage. and pass the url to the page you have previously created with specific document path as query string.

4. this will store the image of the webpage in specified folder.

5. now read that image and display as thumbnail.

I know this is messy solution, but all the other easy methods are not free, unless you want to buy those controls.

:)


这篇关于在C#中为.doc,.xls,.pdf等创建图片缩略图的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆