Hello,
I have a PowerPoint file with a slide that contains a default table, and I want to add HTML text right after the table.
However, when I use the following line:
presentation.Slides.AddFromHtml(htmlTitle);
the code adds the HTML to a new slide instead of inserting it after the existing table.
Best regards,
@MEFMaroc,
Thank you for describing the issue. We are sorry that you encountered this problem. We need more details to investigate the case and help you. Please share the following additional files and information:
- input PowerPoint file
- input HTML file or HTML text
- output presentation file
- Aspose.Slides version you used
I use last version of aspose.Sliders.
@MEFMaroc,
Thank you for the files. The code example below shows how you can add the HTML text right after the table.
using var presentation = new Presentation("Présentation1.pptx");
var firstSlide = presentation.Slides[0];
var table = firstSlide.Shapes[0];
// The position for the HTML text.
var x = table.X;
var y = table.Y + table.Height + 20;
using var htmlStream = File.OpenRead("textToinsertInppt.html");
presentation.Slides.AddFromHtml(htmlStream);
var secondSlide = presentation.Slides[1];
firstSlide.Shapes.AddClone(secondSlide.Shapes[0], x, y);
presentation.Slides.RemoveAt(1);
presentation.Save("output.pptx", SaveFormat.Pptx);
output.zip (26.7 KB)
Shape Manipulations|Aspose.Slides Documentation
First of all, thank you for your response,In the case where I have an HTML that generates multiple slides, this function doesn’t work.
@MEFMaroc,
Could you please share a sample HTML file to demonstrate the problem? We will do our best to help you.
DATA_2.zip (27,9 Ko)
Here is an example of HTML and template.
@MEFMaroc,
Thank you for the sample files. Unfortunately, I was unable to insert the HTML content into the presentation with Aspose.Slides for .NET so that it would start immediately after the table and then be split into separate slides.
We have opened the following new ticket(s) in our internal issue tracking system and will consider your requirements according to the terms mentioned in Free Support Policies.
Issue ID(s): SLIDESNET-44892
You can obtain Paid Support Services if you need support on a priority basis, along with the direct access to our Paid Support management team.