Font color is wrong in imported HTML tags AddFromHTML (C# .NET)

Hello,

My team and I are using Aspose.Slides for .NET 17.11
and we are having a problem with color of paragraphs added from HTML.

Following HTML code
<p><span style="color: rgb(100, 100, 100);">Lorem Ipsum Dolor Sit Amet</span></p>
creates paragraph which color is “{Name=ff0a0a0a, ARGB=(255, 10, 10, 10)}”.

I did some research and I found out when color’s component (R, G, B) is between 100-109 then Aspose framework changes that value to 10.
Similar case is for range 200-209, but here framework changes value to 20.

I.E:
for
<p><span style="color: rgb(50, 108, 128);">Lorem Ipsum Dolor Sit Amet</span></p>
Aspose will create paragraph with following color: RGB( 50, 10, 128)

for
<p><span style="color: rgb(100, 100, 100);">Lorem Ipsum Dolor Sit Amet</span></p>
Aspose will create paragraph with following color: RGB( 10, 10,10)

for
<p><span style="color: rgb(203, 105, 207);">Lorem Ipsum Dolor Sit Amet</span></p>
Aspose will create paragraph with following color: RGB( 20, 10, 20)

I updated Aspose.Slides for .NET to 18.2.1, but described behaviour still occurs.

Regards,
Bartosz

@BartoszDev,

I have observed your comments. Can you please share complete sample project along with environment details so that we can further investigate to help you out.

Hi @Adnan.Ahmad,

thanks for your answer.

There’s not much code to share.
We are retrieve HTML text from database and adding that new paragraph.

var textPlaceHolder = slide.Shapes.OfType<IAutoShape>().FirstOrDefault();            
if (textPlaceHolder == null) return slide;
ITextFrame textFrame = textPlaceHolder.TextFrame;

while (htmlReader.MoveNext())
{
    var text = htmlReader.Current.Text;
    textFrame.Paragraphs.AddFromHtml(text);
}

@BartoszDev,

Thank you for sharing the information. However, we are interested in HTML file or data that you have used to import in Aspose.Slides paragraph and generated presentation. Please share the requested information so that we may proceed further to help you out.

I already provided it in the very first post:
<p><span style="color: rgb(100, 100, 100);">Lorem Ipsum Dolor Sit Amet</span></p>

We are using exactly this line as an input. Nothing more, nothing less.

@BartoszDev,

I have observed the information provided and an issue with ID SLIDESNET-39976 has been created in our issue tracking system to further investigate and resolve the issue. This thread has been linked with the issue so that you may be automatically notified once the issue will be fixed.

1 Like

I too am facing this issue. Strangely the AddFromHtml works for HEX Colors, it’s failing only for RGB().

Is there an ETA to this issue?

@Daedelus,

I have verified from our issue tracking system and regret to share that the issue is unresolved. The tentative ETA for the issue is Aspose.Slides for .NET 19.11. We request for your patience till the time the feature gets available in API.

The issues you have found earlier (filed as SLIDESNET-39976) have been fixed in this update.