//This method parses the pdf and returns a string with text content public static string ParseUsingPdfBox(string filename) { PDDocument doc; try { doc = PDDocument.load(filename); } catch { return null; } var sb = new StringBuilder(); var stripper = new PDFTextStripper(); var lastPage = stripper.getEndPage(); var lastPageMinus10 = lastPage - 10; stripper.setStartPage(1); stripper.setEndPage(10); string temp = stripper.getText(doc); sb.Append(temp); stripper.setStartPage(lastPageMinus10); stripper.setEndPage(lastPage); temp = stripper.getText(doc); sb.Append(temp); doc.close(); return sb.ToString(); }