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.

Mon Jul 03, 2023 8:53 am

Hello,

we have a feature to search text in header, footer or in the whole PDF. Here is part of our code:

Code: Select all
var options = new PdfTextFindOptions();
options.Parameter = Spire.Pdf.Texts.TextFindParameter.IgnoreCase;

foreach (PdfPageBase page in MasterDocument.Pages)
{
    var finder = new PdfTextFinder(page);
    finder.Options = options;

    var finds = finder.Find(pattern);
    if (finds.Count > 0)
        pages.Add(page);
}


This works fine if the text we search in on one line but doesn't work if it is on separate lines.

Adele, Bono and Madonna were successfully found, but Jimmy Page and Mick Jagger were not.

Pls, referee to the attached example pdf.

We use Spire Office for .NET to v. 8.6.0.

Regards

profiler007
 
Posts: 73
Joined: Wed Nov 13, 2019 11:32 am

Mon Jul 03, 2023 10:31 am

Hello,

Thank you for your inquiry.
I tested your PDF file and did reproduce the issue you mentioned. I have logged the issue into our bug tracking system with the ticket number SPIREPDF-6114. Our development team will investigate and fix it. Once it is resolved, I will inform you in time. Sorry for the inconvenience caused.

Sincerely,
Wenly
E-iceblue support team
User avatar

Wenly.Zhang
 
Posts: 149
Joined: Tue May 16, 2023 2:19 am

Fri Sep 08, 2023 9:06 am

Hello,

Thanks for your patient waiting.
I’m writing to inform you that the SPIREPDF-6114 has been resolved. Please download the hotfix (Spire.Office Platinum(Hotfix) Version:8.9.2) from the following link and test it using the example code below.
Website download link: https://www.e-iceblue.com/Download/download-office-for-net-now.html
Nuget download link: https://www.nuget.org/packages/Spire.Office
Code: Select all
var options = new PdfTextFindOptions();
options.Strategy = PdfTextStrategy.Simple;
options.Parameter = Spire.Pdf.Texts.TextFindParameter.IgnoreCase;

foreach (PdfPageBase page in MasterDocument.Pages)
{
    var finder = new PdfTextFinder(page);
    finder.Options = options;

    var finds = finder.Find(pattern);
    if (finds.Count > 0)
        pages.Add(page);
}


Sincerely,
Nina
E-iceblue support team
User avatar

Annika.Zhou
 
Posts: 1657
Joined: Wed Apr 07, 2021 2:50 am

Return to Spire.PDF