如何在我的C#.Met应用程序中导入Word文档和Pdf文件? [英] How Do I Import Word Document And Pdf Files In My C#.Met Application?

查看:93
本文介绍了如何在我的C#.Met应用程序中导入Word文档和Pdf文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想创建包含按钮和富文本框的应用程序

当用户点击按钮时,将打开一个新的对话框,用户将选择word或pdf文件,所选文件内容将被显示在我们的富文本框或任何其他合适的工具中



有一个命名空间Microsoft.office但我在命名空间上的办公室出错了

所以任何人都可以帮我在我们的应用程序中导入文件?

解决方案

你没有解释导入的位置,所以我会留给你。



要阅读Word .docx文档,您可以使用Microsoft Open XML SDK。请参阅本文中引用的过去的答案:如何从MS Visual中添加参考添加microsoft excel 15.0对象库Studio 2010 [ ^ ] 。



要使用PDF,您可以使用 https:// pdfapi .codeplex.com [ ^ ]或http://itextpdf.com [ ^ ]或iTextSharp: http://sourceforge.net/projects/itextsharp [ ^ ]。



-S A

I want to just create application wich contain button and rich text box
while user clicks on button a new dialogue box will open and user will choose word or pdf files and selected files content will be displayed in our rich textbox or any other suitable tool

There is a namespace Microsoft.office but I got an error for office on namespace
so any one can help me to import documents in our application?

解决方案

You did not explain where to import, so I'll leave it to you.

To read Word .docx document, you can use Microsoft Open XML SDK. Please see my past answers referenced in this one: How to add microsoft excel 15.0 object library from Add Reference in MS Visual Studio 2010[^].

To work with PDF, you can use, for example, https://pdfapi.codeplex.com[^] or http://itextpdf.com[^] or iTextSharp: http://sourceforge.net/projects/itextsharp[^].

—SA


这篇关于如何在我的C#.Met应用程序中导入Word文档和Pdf文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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