Spire.Presentation is a professional PowerPoint® compatible library that enables developers to create, read, write, modify, convert and Print PowerPoint documents. Get free and professional technical support for Spire.Presentation for .NET, Java, Android, C++, Python.

Wed Jan 31, 2018 4:29 am

Hi there,
I have a problem when trying to get HTML (which getting from RichText control) and Insert to textbox object.
I followed this tutorial but it's not working.
https://www.e-iceblue.com/Tutorials/Spi ... B.NET.html

Can you verify this for me?
Thank you.

Below is HTML Code

Code: Select all
<h1 style="padding:0px;text-align:left;line-height:90px;font-family:DauphinPlain;font-size:70px;font-weight:400;margin-top:0px;margin-bottom:0px;background-color:#ffffff;"><span style="color:#cc0000;"><strong>Lorem Ipsum</strong></span></h1><h4 style="margin:10px 10px 5px;padding:0px;text-align:left;line-height:18px;font-family:'Open Sans', Arial, sans-serif;font-size:14px;font-style:italic;font-weight:400;background-color:#ffffff;">"Neque porro quisquam est qui dolorem ipsum quia dolor sit amet, consectetur, adipisci velit..."</h4><h5 style="margin:5px 10px 20px;padding:0px;text-align:left;line-height:14px;font-family:'Open Sans', Arial, sans-serif;font-size:12px;font-weight:400;background-color:#ffffff;"><strong>"There is no one who loves pain itself, who seeks after it and wants to have it, simply because it is pain..."</strong></h5><ol><li>11111111111111</li><li>22222222222222</li><li>33333333333333</li></ol><ul><li>aaaaaaaaaaaaaaa</li><li>bbbbbbbbbbbbbb</li><li>cccccccccccccccc</li></ul>

nhatnlh
 
Posts: 8
Joined: Fri Jan 19, 2018 6:42 am

Wed Jan 31, 2018 7:21 am

Hello,

Thanks for your inquiry.
Sorry that our Spire.Presentation only supports the parsing of a small portion of HTML tags. this is why the tags in your sample document like "Hn" and most of the styles could not be formatted correctly. We will consider adding the new feature of supporting more tags in the future. Once there's any good news, I would let you know.

Sincerely,
Jane
E-iceblue support team
User avatar

Jane.Bai
 
Posts: 1156
Joined: Tue Nov 29, 2016 1:47 am

Fri Mar 16, 2018 2:27 am

Can you provide a method which converts that HTML code to simple <p> and <ul> tag, please?

Below is what I need.

1. Enable Break line (convert all tag to <p> tag)
2. Have bullet style (if contains <ul> tag)

Thanks.

nhatnlh
 
Posts: 8
Joined: Fri Jan 19, 2018 6:42 am

Fri Mar 16, 2018 6:44 am

Hello,

Thanks for your inquiry. Spire.Presentation doesn't have such a method. What we can do is supporting more tags in the future. However I have posted your advice to our DEV team to see if it's reachable, once I get back from them, we will inform you.

Best regards,
Simon
E-iceblue support team
User avatar

Simon.yang
 
Posts: 620
Joined: Wed Jan 11, 2017 2:03 am

Tue Apr 10, 2018 4:09 am

Hello nhatnlh,

I 'd like to inform that we added a new method to manipulate the html in the hotfix(Spire.Presentation Pack Hotfix Version:3.4.1) that is, to treat each html tag as a new shape.
Code: Select all
Presentation ppt = new Presentation();
ShapeList shapes=ppt .Slides[0].shapes;
shapes.AddFromHtml(htmlText);


Following is the summary to your previous issues using the new method.
1. Spire.Presentation does not support the setting of the style "padding".
2. Hn/ line-height/font-size/font weight could all be available.
3. Use attribute "background" instead to set the background color of the separate shape.

Sincerely,
Jane
E-iceblue support team
User avatar

Jane.Bai
 
Posts: 1156
Joined: Tue Nov 29, 2016 1:47 am

Return to Spire.Presentation