There are two main class libraries used to read PDF text in. NET: product_box and iTextSharp. Let's talk about consumer box first. This class library is said to be very powerful. Here I will just give a brief introduction: 1. Download consumer box 2. reference the dynamic link library to decompress the downloaded consumer box and find the Bin directory, the dll files to be referenced in the project are: IKVM. GNU. classpath. the dllPDFBox-0.7.3.dllFontBox-0.1.0-dev.dllIKVM.Runtime.dll references the above four files to the project and needs to introduce the following two namespaces in the file: using orgdomainbox. pdmodel; using orgdomainbox. util; 3. Code for using APIs: [csharp] using orgdomainbox. pdmodel; using orgdomainbox. util; public void 20172txt (FileInfo file, FileInfo txtfile) {PDDocument doc = PDDocument. load (file. fullName); inclutextstripper inclustripper = new inclutextstripper (); string text = inclustripper. getText (doc); StreamWriter swPdfChange = new StreamWriter (txtfile. fullName, false, Encoding. getEncoding ("gb2312"); swPdfChange. write (text); swPdfChange. close () ;}itextsharp is used to generate PDF files in many cases, but its ability to read PDF files is not bad. Use the following: 1. Download iTextSharp 2. reference the dynamic link library to decompress the itextsharp-dll-core.zip file in the downloaded package, obtain itextsharp. dll, add reference itextsharp in the project. dll to introduce the following three namespaces in the file: using iTextSharp; using iTextSharp. text; using iTextSharp.text.pdf; 3. Code for using APIs: [csharp] private string OnCreated (string filepath) {try {string pdffilename = filepath; pdfReader pdfReader = new PdfReader (pdffilename); int numberOfPages = pdfReader. numberOfPages; string text = string. empty; for (int I = 1; I <= numberOfPages; ++ I) {byte [] bufferOfPageContent = pdfReader. getPageContent (I); text + = System. text. encoding. UTF8.GetString (bufferOfPageContent);} www.2cto.com pdfReader. close (); return text;} catch (Exception ex) {StreamWriter wlog = File. appendText (System. appDomain. currentDomain. setupInformation. applicationBase + "\ mylog. log "); wlog. writeLine ("error file:" + e. fullPath + "Reason:" + ex. toString (); wlog. flush (); wlog. close (); return null ;}}