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.

Wed Apr 17, 2024 5:54 am

Hello
using PdfTextFragment.HighLight()

the highlighted area is not "transparently", the text it is completely covered.

Code: Select all
  private void button2_Click(object sender, EventArgs e)
  {
      PdfDocument pdfDoc = new PdfDocument(@"d:\tmp\test2.pdf");

      foreach (PdfPageBase page in pdfDoc.Pages)
      {

          PdfTextFinder finder = new PdfTextFinder(page);
          //finder.Options.Parameter = TextFindParameter.WholeWord;
          finder.Options.Parameter = TextFindParameter.IgnoreCase;

          List<PdfTextFragment> finds = finder.Find(this.textBox1.Text);

          foreach (PdfTextFragment fragment in finds)
          {
              // Highlight text
              fragment.HighLight(Color.LightYellow);
          }
      }

      this.pdfDocumentViewer1.LoadFromStream(pdfDoc.SaveToStream(FileFormat.PDF)[0]);
  }




regards peter

peterInStIngbert
 
Posts: 14
Joined: Wed Nov 25, 2020 2:08 pm

Wed Apr 17, 2024 7:09 am

Hi,

Thanks for your inquiry.
I tested your scenario and reproduced your issue, and I logged it into our bug track system with ticket number SPIREPDF-6689. Once it is resolved. I’ll inform you in time.

Sincerely
Abel
E-iceblue support team
User avatar

Abel.He
 
Posts: 1010
Joined: Tue Mar 08, 2022 2:02 am

Thu Oct 10, 2024 3:52 am

Hello abel
is there already a solution to the issue SPIREPDF-6689

Sincerely
Peter

peterInStIngbert
 
Posts: 14
Joined: Wed Nov 25, 2020 2:08 pm

Thu Oct 10, 2024 7:15 am

Hello,

Thanks for your following up. I'm sorry, but this issue hasn't been resolved yet. This issue involves complex color mixing, our Dev team is making the comprehensive adjustments and optimizations for this part now. I have urged them again, and once the hotfix version is available, I will proactively notify you.

Sincerely,
Amin
E-iceblue support team
User avatar

Amin.Gan
 
Posts: 283
Joined: Mon Jul 15, 2024 5:40 am

Return to Spire.PDF