StringBuilder text = new StringBuilder(); PdfReader pdfReader = new PdfReader(pdfFile); for (int page = 1; page <= pdfReader.NumberOfPages; page++) { ITextExtractionStrategy strategy = new SimpleTextExtractionStrategy(); string currentText = PdfTextExtractor.GetTextFromPage(pdfReader, page, strategy); text.Append(System.Environment.NewLine); text.Append("\n Page Number:" + page); text.Append(System.Environment.NewLine); currentText = Encoding.UTF8.GetString(ASCIIEncoding.Convert(Encoding.Default, Encoding.UTF8, Encoding.Default.GetBytes(currentText))); text.Append(currentText); pdfReader.Close(); } richTextBox1.Text += text.ToString();
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)