Home » Source Code » Converting PDF to Text in C#

Converting PDF to Text in C#

maninwest
2015-01-13 05:18:01
The author
View(s):
Download(s): 13
Point (s): 4 
Category Category:
DocumentDocument C SharpC#

Description

1.8.7.dll
然后复制以下文件的 bin 目录:
·         commons-logging.dll
·         fontbox-1.8.7.dll
·         IKVM.OpenJDK.Text.dll
·         IKVM.OpenJDK.Util.dll
·         IKVM.Runtime.dll
使用PDFBox 解析 PDFs非常简单:

using org.apache.pdfbox.pdmodel;
using org.apache.pdfbox.util;
 
// ...
 
private static string ExtractTextFromPdf(string path)
{
  PDDocument doc = null;
  try {
    doc = PDDocument.load(path)
    PDFTextStripper stripper = new PDFTextStripper();
    return stripper.getText(doc);
  }
  finally {
    if (doc != null) {
      doc.close();
    }
  }
}  

下载一个示例项目:
·         How to convert PDF files to text in C# (.NET) [squarepdf.net]
·         How to convert PDF file to text in VB (.NET) [squarepdf.net]
所需集合总大小约 18 MB:
·         IKVM.OpenJDK.Core.dll (4 MB)
·         IKVM.OpenJDK.SwingAWT.dll (6MB)
·         pdfbox-1.8.7.dll (4 MB)
·         commons-logging.dll (82 kB)
·         fontbox-1.8.7.dll (180 kB)
·         IKVM.OpenJDK.Text.dll (800kB)
·         IKVM.OpenJDK.Util.dll (2 MB)
·         IKVM.Runtime.dll (1 MB)
速度尚可: 解析 U.S. Copyright Act PDF (5.1 MB) 花费时间约约 13 S。
不足:
1.       IKVM.NET 依赖 (18 MB)
2.       速度 (尤其是IKVM.NET热身时间)


Sponsored links

File list

Tips: You can preview the content of files by clicking file names^_^
Name Size Date
how_to_convert_pdf_to_text_in.html1.18 kB2014-11-27|14:17
01.97 kB
LICENSE22.56 kB2011-10-31|14:30
THIRD_PARTY_README171.41 kB2011-10-31|14:30
TRADEMARK2.10 kB2010-06-30|15:57
01.97 kB
LICENSE.txt17.67 kB2012-05-25|19:14
NOTICE.txt435.00 B2012-05-25|19:14
01.97 kB
readme.txt133.00 B2012-06-20|19:06
01.97 kB
App.ico1.05 kB2005-12-02|00:29
AssemblyInfo.cs2.37 kB2005-12-02|00:29
Pdf2Text.csproj6.82 kB2014-11-27|14:17
Pdf2Text.sln900.00 B2012-06-20|11:04
Program.cs1.12 kB2014-11-27|13:35
01.97 kB
...
Sponsored links

Comments

(Add your comment, get 0.1 Point)
Minimum:15 words, Maximum:160 words
niuwa
2016-06-13

这个文件非常有用,学习了

  • 1
  • Page 1
  • Total 1

Converting PDF to Text in C# (8.73 MB)(65.14 kB)

Need 4 Point(s)
Your Point (s)

Your Point isn't enough.

Get 22 Point immediately by PayPal

Point will be added to your account automatically after the transaction.

More(Debit card / Credit card / PayPal Credit / Online Banking)

Submit your source codes. Get more Points

LOGIN

Don't have an account? Register now
Need any help?
Mail to: support@codeforge.com

切换到中文版?

CodeForge Chinese Version
CodeForge English Version

Where are you going?

^_^"Oops ...

Sorry!This guy is mysterious, its blog hasn't been opened, try another, please!
OK

Warm tip!

CodeForge to FavoriteFavorite by Ctrl+D