Image tags not being rendered by Paragraphs.AddFromHtml()


#1

Hello,


Using Aspose.Slides version 17.1.0, html image tags are not being rendered byParagraphs.AddFromHtml(). We would like to use Paragraphs.AddFromHtml() to import html that includes image tags. Is this possible? Below is a code example that does not work, attached is the resulting .pptx file.

//Creating a presenation instance
using (Presentation pres = new Presentation())
{
//Accessing the first slide
ISlide slide = pres.Slides[0];

//Adding and accessing Autoshape
IAutoShape aShp = slide.Shapes.AddAutoShape(ShapeType.Rectangle, 200, 200, 400, 200);

//Accessing the text frame of created autoshape
ITextFrame txtFrm = aShp.TextFrame;

//Removing the default exisiting paragraph
txtFrm.Paragraphs.RemoveAt(0);

//****The below lines of code, which include an html tag, will not render the image in the resulting paragraph. We would like image to be rendered.
txtFrm.Paragraphs.AddFromHtml(“

Some text with an img tag!<img src=“http://cdn.images.express.co.uk/img/dynamic/151/590x/secondary/red-galaxy-454959.jpg” />

”);
txtFrm.Paragraphs.AddFromHtml(“

Some text with an img tag!

”);
txtFrm.Paragraphs.AddFromHtml(“

Some text with an img tag!

”);

//Writing the presentation as a PPTX file
pres.Save(“PPTXHtmlImport.pptx”, Aspose.Slides.Export.SaveFormat.Pptx);
}

#2
Hi Gary,

I have worked with the presentation file using Aspose.Slides for .NET 17.1.0 and have been able to reproduce the issue. A ticket with ID SLIDESNET-38193 has been created in our issue tracking system to investigate and resolve the issue. This thread has been associated with the ticket so that we may share the notification with you once issue will be fixed.

We are sorry for your inconvenience,


#3

Hi Adnan ahmad,

Is this issue is resolved now. we too facing the same issue.
Kindly provide work around for this…


#4

@rao.guha,

This issue has been postponed due to more priority issues. We will inform you when this is going to be resolved.


#5

so there is no way to rendering text and image together in aspose slides using .net??


#6

@rao.guha,

At present the API only support text related tags import in paragraph of slide shapes. Importing tags like table and images are not presently supported. However, the API does allow you to add image inside slide directly (without importing from HTML).