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.

Tue Mar 06, 2018 3:14 pm

I need to insert formatted HTML from a rich text editor into a PPT text area. This code may have images embedded using the form <img src="data:image/png;base64,...(base64 encoded image)..."> - which I assume is not supported in Spire, because the results come up as little black boxes in the resulting output.

If I can find a way to extract the images, save them to a temp location, and convert the HTML to <img src="path"> format, will this work to get them to show up? If so, will the resulting PPTX have the images embedded in the file so the referenced files don't need to be maintained?

drl2
 
Posts: 4
Joined: Thu Feb 15, 2018 3:37 pm

Wed Mar 07, 2018 3:02 am

Hello,

Thanks for your inquiry. I am sorry Spire.Presentation doesn't support the img tag at present and the image can't be embed to the PPT. However, I have posted your requirement to our DEV team to see if it's reachable. If any update, we will let you know.

Best regards,
Simon
E-icelbue
User avatar

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

Thu Mar 08, 2018 8:25 pm

For future reference would it be possible for you to publish a list of what tags are currently supported? Might save a lot of trial and error for some of your customers.


Simon.yang wrote:Hello,

Thanks for your inquiry. I am sorry Spire.Presentation doesn't support the img tag at present and the image can't be embed to the PPT. However, I have posted your requirement to our DEV team to see if it's reachable. If any update, we will let you know.

Best regards,
Simon
E-icelbue

drl2
 
Posts: 4
Joined: Thu Feb 15, 2018 3:37 pm

Fri Mar 09, 2018 2:56 am

Hello,

Thanks for your kind suggestion.
Actually, html tags are not very well supported in our Spire.Presentation currently and we always do improvements to better support them. For your need, we will do some investigations and give you a list of currently supported html tags. Once any update,we will let you know.

Sincerely,
Nina
E-iceblue support team
User avatar

Nina.Tang
 
Posts: 1195
Joined: Tue Sep 27, 2016 1:06 am

Tue Aug 11, 2020 10:40 am

Hi,

Sorry for the long silence.
Our Dev team did some optimizations for adding HTML in PowerPoint file and the img tag is supported well now, please download the latest Spire.Presentation (Spire.Presentation Pack Hotfix Version:5.8.1) and use the following code to have a try. In addition, we made a list of currently supported html tags for your kind reference.
Code: Select all
//Create an instance of presentation document
Presentation ppt = new Presentation();
ShapeList shapes = ppt.Slides[0].Shapes;
//Insert html with img
shapes.AddFromHtml("<html><div><p>First paragraph</p><p><img src='..\\..\\..\\..\\..\\..\\Data\\Logo.png'/></p><p>Second paragraph </p></html>");
//Save the document
string result = "InsertHtmlWithImage.pptx";
ppt.SaveToFile(result, FileFormat.Pptx2013);

Sinecerly,
Nina
E-iceblue support team
User avatar

Nina.Tang
 
Posts: 1195
Joined: Tue Sep 27, 2016 1:06 am

Return to Spire.Presentation