Domanda

I am implementing some print functionality in C#

Before actual printing I show the contents in PDF form-

There are some RTF contents which I want to display on PDF which is working well except the RTF with highlighted text (having background color)

ex - enter image description here

But when I display this on PDF, it looks like enter image description here

I get the HTML as follows

<span style="background-color: rgb(255, 255, 0);">Some highlighted text</span><br>

Which I am converting to RTF using following function

public string ConvertToRtf(this string htmlString)
{
   var htmlToRtf = new SautinSoft.HtmlToRtf();
   htmlToRtf.Serial = "10034959528";
   return htmlToRtf.ConvertString(htmlString);
}

If I do not convert it to RTF, it sreightforwad display it like <span style="background-color: rgb(255, 255, 0);">Some highlighted text</span><br>

Please tell me how can I display it accurately in pdf

È stato utile?

Soluzione

I see that you're using SautinSoft components. I think the best place to ask this question is their support forums.

Anyway you might want to try to check the rtf tag for the highlighted text. If it is \cb you can try to change it to \highlight, or vice versa ...

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top