预览文档(Word,Excel和PDF,文本文件等)内的C#的WinForms? [英] Previewing documents (Word, Excel, PDF, text file, etc) within C# WinForms?

查看:737
本文介绍了预览文档(Word,Excel和PDF,文本文件等)内的C#的WinForms?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我开发一个C#WinForms应用程序,我希望能够在其中预览的各种文档类型。即,当用户从列表中的文件名,它下面示出,同样的形式中,所选择的文件的预览。这是一个很多像他们这样的Outlook可以让你预览,而不双击选定的信息。

I am developing a C# WinForms application, and I would like to be able to "preview" various document types within it. That is, when a user selects a filename from a list, it shows below, within the same form, a preview of the selected file. It's a lot like they way Outlook allows you to preview a selected message without double-clicking.

有没有什么办法范围内采取只是一个文件名,并创建一个控制动态我WinForms应用程序,显示该文件的内容是什么?

Is there any way to take just a filename and create a control dynamically within my WinForms application that shows the contents of that file?

推荐答案

如果要提供的文件类型的预览/只读版本,一个想法,可能是第一批实施PDF浏览,这主要涉及转换的PDF页面图像,然后创建那些视图。一旦你有做过(使用GhostScript的或其它商业组件)然后你可以在转换其他格式为PDF工作,并使用PDF查看选项,你可能不通过文字自动化和基于文本文件的大多数办公文档可以直接显示出来(可能使用格式化的文本富文本编辑器)

If you want to provide a preview/readonly version of the file types, an idea might be to implement PDF viewing first, this primarily involves converting PDF pages to images and then creating a view for those. Once you have that done (using GhostScript or other commercial components) you can then work on converting other formats to PDF, and use the PDF viewing option, you can probably do most office documents through word automation and text based files could be displayed directly (possibly using a rich text editor for formatted text)

心连心

这篇关于预览文档(Word,Excel和PDF,文本文件等)内的C#的WinForms?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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