First, download PDFBox
Visit URL http://sourceforge.net/projects/pdfbox/(This is definitely a good website)
Second, the reference dynamic link library
To extract the pdfbox of the download, locate the bin directory where you want to add the referenced DLL file to the project:
IKVM. Gnu. Classpath.dll
Pdfbox-0.7.3.dll
Fontbox-0.1.0-dev.dll
IKVM. Runtime.dll
Referring to the above 4 files to the project, you need to introduce the following 2 namespaces in the file:
Using Org.pdfbox.pdmodel;
Using Org.pdfbox.util;
Third, the use of the API method
Using System.IO;
Using System.Text;
Using Org.pdfbox.pdmodel;
Using Org.pdfbox.util;
Namespace Pdfreader
{
Class Program
{
public static void Pdf2txt (FileInfo pdffile, FileInfo txtfile)
{
PDDocument doc = Pddocument.load (pdffile. FullName);
Pdftextstripper pdfstripper = new Pdftextstripper ();
string text = Pdfstripper.gettext (DOC);
StreamWriter swpdfchange = new StreamWriter (txtfile. FullName, False, Encoding.GetEncoding ("gb2312"));
Swpdfchange.write (text);
Swpdfchange.close ();
}
static void Main (string[] args)
{
Pdf2txt (The new FileInfo (@ "c:/users/susan/desktop/complete Manuscript __ The year _ Nine Night Anise"), New FileInfo (@ "c:/users/susan/desktop/full version __") Hurried that year _ Nine night anise.
}
}
Translating Chinese is no problem, cause you should know.