We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Searching with Textfragment

Hello
When I am searching PDF using TextFragmentAbsorber, I don’t get search results though text is found in PDF document. Please find document.input.pdf (46.0 KB)

static void Main(string[] args)
{
string FileIn = @“c:\users\raja_c\Downloads\input.pdf”;
string FileOut = @“c:\users\raja_c\Downloads\output.pdf”;
TextFind(FileIn, FileOut);
}

   public static void TextFind(String FileIn, String FileOut)
    {
        Document document = new Document(FileIn);
        TextFragmentAbsorber textobs = new TextFragmentAbsorber("Table of contents");
        document.Pages.Accept(textobs);
        TextFragmentCollection textFragmentCollection = textobs.TextFragments;
        Console.WriteLine(textFragmentCollection.Count);
    }

@crshekharam

We were able to reproduce the issue in our environment with Aspose.PDF for .NET 20.5 and logged it as PDFNET-48149 in our issue tracking system. We will further check this issue in details and keep you posted with the status of its rectification. Please be patient and spare us some time.

We are sorry for the inconvenience.