ASPForums.Net RSS Feedhttp://www.aspforums.net/Handlers/RSS.ashxLatest additions to the content that appears on ASPForums.Net(c) 2017 www.aspforums.com. All rights reserved.Read and extract searched text from pdf file using iTextSharp in ASP.Net<p>Hi <a class="username" rel="Sneha123"> Sneha123</a>,</p> <p>I will get back to you soon.</p>http://www.aspforums.net/Threads/132819/Read-and-extract-searched-text-from-pdf-file-using-iTextSharp-in-ASPNet/http://www.aspforums.net/Threads/132819/Read-and-extract-searched-text-from-pdf-file-using-iTextSharp-in-ASPNet/Fri, 16 Dec 2016 01:54:54 GMTRead and extract searched text from pdf file using iTextSharp in ASP.Net<p>cool!!! Thanks</p>http://www.aspforums.net/Threads/132819/Read-and-extract-searched-text-from-pdf-file-using-iTextSharp-in-ASPNet/http://www.aspforums.net/Threads/132819/Read-and-extract-searched-text-from-pdf-file-using-iTextSharp-in-ASPNet/Fri, 16 Dec 2016 02:13:57 GMTRead and extract searched text from pdf file using iTextSharp in ASP.Net<p>Hi <a class="username" rel="Sneha123"> Sneha123</a>,</p> <p>Refer the below code.</p> <pre class="brush: csharp">string file = Server.MapPath(&#34;~/test.pdf&#34;); if (System.IO.File.Exists(file)) { string searchText = textBox.Text.Trim(); string currentText = string.Empty; System.Text.StringBuilder pdfText = new System.Text.StringBuilder(); iTextSharp.text.pdf.PdfReader pdfReader = new iTextSharp.text.pdf.PdfReader(file); for (int page = 1; page &lt;= pdfReader.NumberOfPages; page++) { iTextSharp.text.pdf.parser.ITextExtractionStrategy strategy = new iTextSharp.text.pdf.parser.SimpleTextExtractionStrategy(); currentText = iTextSharp.text.pdf.parser.PdfTextExtractor.GetTextFromPage(pdfReader, page, strategy); currentText = System.Text.Encoding.UTF8.GetString(System.Text.Encoding.Convert (System.Text.Encoding.Default, System.Text.Encoding.UTF8, System.Text.Encoding.UTF8.GetBytes(currentText))); pdfText.Append(currentText); } pdfReader.Close(); List&lt;string&gt; lines = new List&lt;string&gt;(); lines = pdfText.ToString().Trim().Split(&#39; &#39;).ToList(); List&lt;string&gt; matchedWord = new List&lt;string&gt;(); foreach (string item in lines) { if (!string.IsNullOrEmpty(item)) { if (item.ToUpper().Contains(searchText.ToUpper())) { matchedWord.Add(item); } } } }</pre> <p>&nbsp;</p>http://www.aspforums.net/Threads/132819/Read-and-extract-searched-text-from-pdf-file-using-iTextSharp-in-ASPNet/http://www.aspforums.net/Threads/132819/Read-and-extract-searched-text-from-pdf-file-using-iTextSharp-in-ASPNet/Fri, 16 Dec 2016 06:13:09 GMTRead and extract searched text from pdf file using iTextSharp in ASP.Net<p>Thank u so much Dharmendr..It helped!!!</p>http://www.aspforums.net/Threads/132819/Read-and-extract-searched-text-from-pdf-file-using-iTextSharp-in-ASPNet/http://www.aspforums.net/Threads/132819/Read-and-extract-searched-text-from-pdf-file-using-iTextSharp-in-ASPNet/Sat, 17 Dec 2016 00:28:51 GMT