Free Support Forum -

Highlight single word in SVG

Hello. How can I highlight one word in an SVG file with Aspose.HTML (highlight the background, not the color of the letters)? Word is a part of the text element.


You may please try using the below code snippet:

using (var document = new Aspose.Html.HTMLDocument(htmlFile))
 document.DocumentElement.InnerHTML = document.DocumentElement.InnerHTML.Replace("Target Text", "<span style='background-color: yellow;'>Target Text</span>");

Thanks, but it is not an HTML. It is SVG file. And this solution isn’t working.


Please share your SVG file with us for our reference. We will test the scenario in our environment and address it accordingly. (5.6 KB)
Thank you. Here is the SVG file.


We have logged a feature request as HTMLNET-3109 in our issue tracking system for the sake of implementation of required functionality. We will further investigate the feasibility of this feature and keep you posted with the status of its availability. Please be patient and spare us some time.

We apologize for the inconvenience.