在 C# 中阅读 PDF

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/1340278/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-06 15:21:06  来源:igfitidea点击:

Reading PDF in C#

c#pdfrichtextbox

提问by user162558

I want to read and display the contents of the PDF files into my RichtextBox. I am using windows application C#. Is it possible? What is the way to do it?

我想读取 PDF 文件的内容并将其显示到我的 RichtextBox 中。我正在使用 Windows 应用程序 C#。是否可以?有什么方法可以做到?

回答by Akash Kava

You should checkout PDFSharplibrary and they have preview component, where else extracting text and showing them in RichTextBox could be little bit of more work, but you can try this.

您应该检查PDFSharp库,它们有预览组件,在其他地方提取文本并在 RichTextBox 中显示它们可能需要更多的工作,但您可以试试这个。

回答by James

You can use Adobe PDF IFilter Libraryto convert a PDF document to text.

您可以使用Adobe PDF IFilter Library将 PDF 文档转换为文本。

Also see an example on the CodeProject

另请参阅CodeProject上的示例

回答by KB22

Since PDF is an binary format you'll have to use a pdf-library like pdflib in order to read pdf-files.

由于 PDF 是二进制格式,因此您必须使用 pdflib 之类的 pdf 库才能读取 pdf 文件。

pdfLib

pdf库

回答by Vinay Sajip

iTextSharpis another alternative PDF library for .NET.

iTextSharp是 .NET 的另一个替代 PDF 库。