Click here to Skip to main content
Sign Up to vote bad
good
See more: C#Visual-Studio
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
Posted 28 Feb '13 - 2:37
Edited 28 Feb '13 - 2:45


1 solution

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Your Filters
Interested
Ignored
     
0 OriginalGriff 253
1 Rohan Leuva 220
2 Mahesh Bailwal 190
3 Ron Beyer 180
4 Abhinav S 168
0 Sergey Alexandrovich Kryukov 8,528
1 OriginalGriff 6,819
2 CPallini 3,643
3 Rohan Leuva 2,923
4 Maciej Los 2,288


Advertise | Privacy | Mobile
Web02 | 2.6.130516.1 | Last Updated 28 Feb 2013
Copyright © CodeProject, 1999-2013
All Rights Reserved. Terms of Use
Layout: fixed | fluid