将pdf或Docx文件转换为文本文件 [英] Convert pdf or Docx file into text file

查看:122
本文介绍了将pdf或Docx文件转换为文本文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



如何将pdf或docx文件转换为文本文件..

Hi,
How I can convert pdf or docx file into text file..

推荐答案

要使用PDF,您可以使用iText或其.NET端口,iTextSharp:

http://en.wikipedia.org/wiki / IText [ ^ ],

http://itextpdf.com/ [ ^ ],

http://sourceforge.net/projects / itextsharp / [ ^ ]。



包括对Java iText网站的引用,因为大多数文档都在那里。如果您了解C#,那么理解基于Java的API文档并不困难。



要使用DOCX,您可以使用Office Interop程序集或Microsoft Open XML SDK。建议不要使用互操作。以下是Microsoft在服务器环境中使用互操作的警告:

http://support.microsoft.com/default.aspx?scid=kb;EN-US;q257757#kb2 [ ^ ],

http://support.microsoft.com/kb/257757/en-us [ ^ ]。



如需了解更多详情,请参阅我过去的答案和参考答案:如何从MS Visual Studio中的添加参考添加microsoft excel 15.0对象库2010 [ ^ ]。



-SA
To work with PDF, you can use iText, or its .NET port, iTextSharp:
http://en.wikipedia.org/wiki/IText[^],
http://itextpdf.com/[^],
http://sourceforge.net/projects/itextsharp/[^].

In included the reference to Java iText site as well, because most documentation is there. If you understand C#, it would not be difficult to understand Java-bases API documentation.

To work with DOCX, you can use either the Office Interop assemblies or Microsoft Open XML SDK. The interop is less recommended. Here are the warnings from Microsoft on using of interop in server environment:
http://support.microsoft.com/default.aspx?scid=kb;EN-US;q257757#kb2[^],
http://support.microsoft.com/kb/257757/en-us[^].

For further detail, please see my past answer and referenced answers: How to add microsoft excel 15.0 object library from Add Reference in MS Visual Studio 2010[^].

—SA


这篇关于将pdf或Docx文件转换为文本文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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