We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Help with Import from HTML; Slide Text White Except for Span Tags with Class Property Set

Basically I am trying to make a slide presentation with data from an HTML source (see CodeSnippet txt attachment). The problem is that except for the span tags, which come out blue and italics like they are supposed to, the text comes out white so that you can't see it. The bulleting format is there and the HTML displays like it is supposed to when you view just the html part in a browser(see image attachment).

How can I get the slide text to format/color the way it appears in the HTML browser?

UPDATE: If I put a “span” inside of the “li” tag that sets the “class”, then the formatting comes through. I do not want to insert span tags for every list item (li).

Can anyone repeat the same results that I am getting? After I put that span in in the li tag and tested it, I then returned everything back to normal in the html and now the text that is supposed to be blue is blue but not italicized like before. I am just wondering if it is a problem on my dev machine or if others can repeat the problem.

Hi Kevin,


Thank you for considering Aspose.Slides.

I have observed your comments and like to request you to please share with us the html file from which you are importing the text so that we may investigate it further to help you out.

Best Regards,

The HTML is in the code snippet attachment, inline in the code where it is used in "ashape.TextFrame.Paragraphs.AddFromHtml" but below is the HTML again:




.blueItalic { color: #0000ff; font-style:italic;} body { color:#000000; background-color: #fff; border-width: 0px;margin-top: 0px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; padding-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; } body,table,td {color:#000000; font-family: verdana,sans-serif; font-size: 10pt; } h1 { font-size: 24pt; } h2 { font-size: 18pt; } h3 { font-size: 14pt; } h4 { font-size: 12pt; } h5 { font-size: 10pt; } h6 { font-size: 8pt; }





  • Shortfalls: This better work eoritu eroitu 11 rr


    • dflgk dflgk;dflgkdfgk dfg kl dfkl;dd ddd

    • dkflgj dfklj retio ert


  • Impact: dfjkgh dkfjgh dfjkh dfjgh jdfgh dfjgh jhfdgjh er dfjgh djfgh dfjgh dfjgh dfjgh dfjh dfjh dfjh dfjghdfgjhdf djfkh dfjh dfjkh dfgjk



  • Disconnect: hfgh fghfghfg fghfgh fghfg



  • Resolution:


    • eritu eriou eriou ert

    • dfjkh dfgjkh dfgkjdhf gkjdg

    • dflkgj dflgkj dflgjk dflkgj dfg

    • xcvb xcbv xcmvb xopiopiopicvb xcv





BD: May 17     WD: Oct 17



UPDATE: I tried deleting the style node and putting span tags inside the p tag with style attribute set. When I specified a color like #000000 (black) the whole text would turn out black despite the internal span tags that specified blue (#0000ff), but the italics would still be there. When I took out the color attribute the text turned out white except for the inner span tags that specified blue and italics.

Hi Kevin,


I have observed your comments and worked over your requirements. I have been able to reproduce the issue on my end. A ticket with ID SLIDESNET-36755 has been logged into our issue management system to further investigate and resolve the issue. This thread has been linked with the issue so that you may be automatically notified as soon as the issue will be resolved.

We are sorry for your inconvenience,

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


This message was posted using Notification2Forum from Downloads module by Aspose Notifier.

Please verify that the above HTML posted in this thread works with the new fix.

I tried the new dll for Aspose.Slides for .NET 15.7.0 and then tried the .msi. I set a reference to the updated dll and I still have the same problem.

Hi Kevin,


I have observed your comments and like to share with you that, By default new shape color settings are copied from default presentation color scheme, therefore font color is Light1 (#FFFFFF) and fill color is Accent1 (#4F81BD).

Changing shape FillFormat to ‘FillFormat.NoFill’, you make shape’s background color from #4F81BD to transparent and it appears white because slide’s fill color is white. So now you have font color #FFFFFF and background color #FFFFFF - that’s why all text appearing invisible except tags with explicitly set styling.

To fix it, in addition to changing FillFormat you should change shape’s style colors as following:

ashape.ShapeStyle.FontColor.Color = Color.Black;
ashape.ShapeStyle.LineColor.Color = Color.Transparent;

Or as alternative option set shape’s style like this:

ashape.FillFormat.FillType = FillType.Solid;
ashape.FillFormat.SolidFillColor.Color = Color.White;
ashape.ShapeStyle.FontColor.Color = Color.Black;
ashape.ShapeStyle.LineColor.Color = Color.White;

Please take a note that these parameters can not be set from HTML styles as they relate to the entire shape but not to single paragraph that is imported from HTML markup.

I hope this will be helpful. Please share if I may help you further in this regard.

Best Regards,

I was told when I purchased ASPOSE that the slides would accept HTML formatting/styles.

However from this example if I change the FontColor to black then the whole shape’s text will be black regardless of the spans with the style set to a different color in the HTML.

I need it exactly how it displays in the browser, outline form with black text and blue-italics text here and there based on the spans.

So how do I accomplish this? Can I change the default new shape color settings from the default presentation color scheme? Can I separate out the HTML and add different shapes with different formatting and add them all back together again? By separating the HTML text into different sections/paragraphs can I set the font color based on where my HTML spans are?

OK I think I have it working, although it is not the optimal solution.

  1. I tried simplifying the style to just:
    &ltstyle id=‘oboutEditorDefaultStyle’&gt
    .blueItalic { color: #0000ff; font-style:italic;}
    &lt/style&gt


  2. Next I added a style color of black to the body: &ltbody style=‘color:#000000;’&gt


  3. This gave me black text and spans were blue, but they were not italicized.


  4. Just to experiment I took out the color attribute from .blueItalic to see if just the italics would work but it did not.


  5. Next I put in font-family in .blueItalic after color and that worked.


  6. So my assumption is that it is having a problem with italic, maybe due to the word style in font-style.


  7. Based on #6 above I tried putting in &lti&gt &lt/i&gt tags around my spans and that worked.



    Conclusion: There is something wrong with font-style: italic, maybe the word style. The workaround is clunky because you have to insert &lti&gt&lt/i&gt around each one of your span tags.

Hi,


Thank you for getting back to us.

I have observed your comments and have shared your feedback with our product team. We will update you as soon as we hear from our product team in this regard.

Best Regards,

Hi,


I would like to share with you that the solution shared by us earlier, works perfect and you do not need to do any clunky workaround. However, a ticket with ID SLIDESNET-36768 has been logged into our issue management system to further investigate and resolve the issue of Poor styles support for HTML import. This thread has been linked with the issue so that you may be notified automatically as soon as the issue will be fixed.

We are sorry for your inconvenience,