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

Free Support Forum - aspose.com

addFromHtml() function not supporting HTML tags

Hi Team,

I am facing issues with HTML support using function addFromHtml() from ParagraphExCollection class, this method does not seem to support the below -

  • Superscript/Subscript using tag
  • Changing type of bullet using style='list-style-type:square’
I am using aspose library version 7.3 and also tried using latest library version 14.5, none of them seem to offer the support for above mentioned output.

Attached are the output displaying discrepancy in rendering.

Kindly advise

Thanks

Hi Harry,

I have observed the presentation file shared by you and request you to please try using Aspose.Slides for Java 14.6.0 on your end. If there is still an issue then please share the sample code and source html used on your end. I will investigate the issue on provision of requested information on my end to help you further in this regard…

Many Thanks,

Tried with suggested library that is 14.6.0, still the same output. unable to attach HTML file here due to some file type constraints on aspose portal. find below the HTML text

"

<span style=’‘color:#0070C0’’>Historical stable, consistent excess returns

<span style=’‘color:#000000’’>Next paragraph bold <span style=’‘color:#C00000’’>colored <span style=’‘color:#000000’’>Superscript me!

<span style=’‘color:#000000’’><ul style=’‘list-style-type:square’’>

  • <span style=’‘color:#0070C0’’>Coffee
  • Tea
  • Milk
  • "


    Thanks

    Hi Haryy,

    I have worked with the HTML content shared by you and have tried importing that to presentation using sample code shared over this documentation link and Aspose.Slides for Java 14.6.0. I have obtained the attached output on my end. For your kind reference, I have attached the HTML and generated presentation snapshot as well. I hope this will be helpful. Please share with us if I may help you further in this regard.

    Many Thanks,

    Thanks for your effort, now my questions are related to classes to be used for this purpose

    As suggested by you I have tried using the sample code mentioned in the example you sent(see attached class AddHtmlTextToSlide1.java and output slide addhtmltextoutput2121.pptx).
    Now the other class with which I was trying AddHtmlTextToSlide.java and output slide addhtmltextoutput2.pptx. Can you please explain an alternative approach for below issues:

    • The example in your link uses class Presentation for creating a presentation object while in my application code I use PresentationEx class. The output using the two classes are definitely not same and I cant refactor my code to use different object for different specific purpose.
    • The style=‘list-style-type:square’ is still not being rendered by either of the examples as you can see in your generated slide output.
    Kindly advise.


    Thanks

    Hi Haryy,

    I have observed the sample codes shared by you and like share that the only difference between two codes is that you are using the old API and the one I have shared is based on new API. The old API is no longer supported from this month and only support and new versions will be released based on new unified API.

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

    Many Thanks,