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 Aug 10, 2021 9:27 pm

Hello,

We are using this code to find and highlight text. The problem I am facing is that the entire text "ABC" is not highlighted, but only the first two characters "AB" are highlighted.

PdfTextFind[] results = doc.Pages[0].FindText("ABC").Finds;
foreach (PdfTextFind result in results)
{
result.ApplyHighLight(Color.GreenYellow);
}

Please suggest how can I fix this?

Thanks in advance for your help!

kundansingh
 
Posts: 1
Joined: Tue Aug 10, 2021 9:09 pm

Wed Aug 11, 2021 9:32 am

Hello,

Thank you for your inquiry.
I simulated a PDF file and tested your code, but did not find your issue. The version I used is the latest version(Spire.PDF Pack(Hot Fix) Version:7.8.2). If you were not using the latest version, please first give it a try. If the issue still exists after trying, please provide your sample PDF file for further investigation. You could attach it here or send to us via email ([email protected]). Thanks in advance.

Sincerely,
Annika
E-iceblue support team
User avatar

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

Thu Aug 19, 2021 8:09 am

Hello,

Hope you're doing well.
How is your issue going? Has it been resolved? If not, could you please provide your sample PDF file to us for further investigation? You could attach it here or send to us via email ([email protected]). Thanks in advance.

Sincerely,
Annika
E-iceblue support team
User avatar

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

Return to Spire.PDF

cron