Hi,
I am using below code to exract text from pdf file,
public string ReadPdfFile()
{
string strText = string.Empty;
try
{
PdfReader reader = new PdfReader(@"\\FilePath");
for (int page = 1; page <= reader.NumberOfPages; page++)
{
ITextExtractionStrategy its = new iTextSharp.text.pdf.parser.SimpleTextExtractionStrategy();
String s = PdfTextExtractor.GetTextFromPage(reader, page, its);
s = Encoding.UTF8.GetString(ASCIIEncoding.Convert(Encoding.Default, Encoding.UTF8, Encoding.Default.GetBytes(s)));
strText = strText + s;
}
reader.Close();
}
catch (Exception ex)
{
}
return strText;
}
This code returns all the text from one page of the PDF file, I need to highlight any word of my choice on that PDF page with yellow colour.
Any ideas how to do that?
Regards,
Kane