Spire.PDF is a professional PDF library applied to creating, writing, editing, handling and reading PDF files without any external dependencies. Get free and professional technical support for Spire.PDF for .NET, Java, Android, C++, Python.

Tue Sep 25, 2018 12:52 pm

Hello,

I want to search text "sites still" in the attached .pdf file, I am using the following code:
PdfTextFind[] result = null;
int i = 0;
int[] n = new int[pdf.Pages.Count];
List<int> intList = new List<int>();
string json="";
foreach (PdfPageBase page in pdf.Pages)

{

result = page.FindText("sites still", true).Finds;

foreach (PdfTextFind find in result)

{

string outerText = find.OuterText;


}

}


}

But I don't get right result . please can you suggest me what should I do to get right result.


Thank you,
Kind regards,
Nilarya Talukdar.

nilarya
 
Posts: 20
Joined: Mon Mar 19, 2018 7:23 am

Wed Sep 26, 2018 6:45 am

Hello Nilarya,

Thanks for your post.
I have reproduced the issue and logged it into our bug tracking system for investigating and fixing. Once there is any update, I will let you know. Sorry for the inconvenience caused.

Sincerely,
Lisa
E-iceblue support team
User avatar

Lisa.Li
 
Posts: 1536
Joined: Wed Apr 25, 2018 3:20 am

Sun Sep 30, 2018 5:52 am

Hello Nilarya,

Thanks for your patience.
I got the news from Dev team that our Spire.PDF only supports searching text in one line of PDF at present, but not supports searching text in two lines of PDF. We will add it into our upgrade list as a new feature, and I'm afraid the new feature can't be finished in a short time due to the complexity. Once the feature is implemented, we will let you know. Thanks for your understanding.

Sincerely,
Lisa
E-iceblue support team
User avatar

Lisa.Li
 
Posts: 1536
Joined: Wed Apr 25, 2018 3:20 am

Thu Apr 04, 2019 10:42 am

Hello,

Greetings from E-iceblue.
Glad to inform you that we just released Spire.PDF Pack(Hot Fix) Version:5.4.1, it supports searching text in two lines now. Please download and refer to the following sample code to test it.
Our website link: https://www.e-iceblue.com/Download/down ... t-now.html
NuGet link: https://www.nuget.org/packages/Spire.PDF/
Code: Select all
PdfDocument pdf = new PdfDocument(@"LoremPdf.pdf");
PdfTextFind[] result = null;
foreach (PdfPageBase page in pdf.Pages)
{
    result = page.FindText("sites still", TextFindParameter.CrossLine | TextFindParameter.IgnoreCase).Finds;

    foreach (PdfTextFind find in result)
    {
        find.ApplyHighLight(Color.Green);
    }
}
pdf.SaveToFile("result.pdf");

Sincerely,
Lisa
E-iceblue support team
User avatar

Lisa.Li
 
Posts: 1536
Joined: Wed Apr 25, 2018 3:20 am

Tue Apr 09, 2019 7:57 am

Hello,

Greetings from E-iceblue.
Did the hotfix work for you? Your feedback will be highly appreciated. Thanks in advance.

Sincerely,
Lisa
E-iceblue support team
User avatar

Lisa.Li
 
Posts: 1536
Joined: Wed Apr 25, 2018 3:20 am

Return to Spire.PDF

cron