Converting PPTX to HTML with images

Hi there,

I wanted to know if there is a way to either optimize a PPTX before converting it to HTML or if it’s possible to customize the way images in PPTX files are converted into HTML documents. The issue I have is that some of the PPTX files I’m converting have large images that cover the entire slide. After the conversion happens, I can see that the HTML code generated is representing the images as SVG symbols inside the HTML. This is causing the files size to be quite large. Is there a way to have associated images saved as .jpg or similar and then have that inside the generated HTML?
Thanks…

Hi Willaam,


Thanks for inquiring Aspose.Slides.

I like to share that you can use HtmlOptions class to set the images formats for the slide in html. Please use the following code snippet for your convenience. Hopefully, it will help you in understanding and using the HtmlOptions.

public static void ExporToHtml()
{
String path = “D:\Aspose Data\”;
PresentationEx pres = new PresentationEx(path + “OCM.pptx”);
Aspose.Slides.Export.HtmlOptions options = new Aspose.Slides.Export.HtmlOptions();
Aspose.Slides.Export.SlideImageFormat htmlform=new Aspose.Slides.Export.SlideImageFormat();
//Either use this
options.SlideImageFormat = Aspose.Slides.Export.SlideImageFormat.Bitmap(1f, System.Drawing.Imaging.ImageFormat.Jpeg);
//Or use this at any time
Aspose.Slides.SVGOptions svgOpts=new Aspose.Slides.SVGOptions();
svgOpts.JpegQuality=50;
options.SlideImageFormat = Aspose.Slides.Export.SlideImageFormat.Svg(svgOpts);
options.JpegQuality = 50;
pres.Save(path + “OCM.html”, Aspose.Slides.Export.SaveFormat.Html, options);
}


Many Thanks,