aspose-free-consulting / projects

The starting point for Aspose free consulting projects
5 stars 5 forks source link

Convert PPTx to HTML #268

Open karthiselvaraj opened 1 year ago

karthiselvaraj commented 1 year ago

Hi,

We have a requirement to convert pptx/pdf to HTML, further we are supposed to edit the converted HTML file, so for this the HTML file should contain DIV/SPAN/P/A but not SVG element. Can Aspose package fulfill the requirement?

Thanks!

Regards, Karthick

andreypotapovaspose commented 1 year ago

@karthiselvaraj, Thank you for posting your requirements.

Please clarify the following. If a PowerPoint presentation contains an SVG image, what do you expect in the output HTML document instead of that image? Should the SVG image be rasterized to a bitmap?

karthiselvaraj commented 1 year ago

We have tried using the trail version of Aspose.Slides dll to convert PPTX slides to HTML. We have found all the slides converted to SVG though the PPTX not containing the SVG images. Incase if the PPTX contains SVG images its fine to have the same SVG image in the HTML . If the PPTX slides contain only text we expect the HTML output to be as div/span/paragraph elements instead of SVG which will allow us to edit the converted html. Our primary agenda is to edit the final html document and the converted HTML should support that.

andreypotapovaspose commented 1 year ago

@karthiselvaraj, Thank you for the details. Please share the following data and information:

We will then check the problem soon.

karthiselvaraj commented 1 year ago

Sample.zip

Hi, Please check details below, Let me know if you need more info Thank you in advance

sample presentation file - attached code example that reproduces the problem -

public static void Aspose_PPTtoHTML()        {             var presentation = new Presentation(@"demo.pptx"); // save the presentation as PDF             presentation.Save(@"demo.html", Aspose.Slides.Export.SaveFormat.Html);         }

output HTML file - attached OS version on which the code was executed - Windows 11 .NET target platform in your app - .Net 6 Aspose.Slides version you used - 22.11.0

andreypotapovaspose commented 1 year ago

@karthiselvaraj, Thank you for the additional information. I converted the presentation to an HTML document and also saw the SVG elements in the document structure. I did not find a way to disable this behavior. I've added a ticket with ID SLIDESNET-43636 to our issue-tracking system. Our development team will consider your requirements. You will be notified when a new release of Aspose.Slides with a fix or options is published.

karthiselvaraj commented 1 year ago

Thanks @andreypotapovaspose As a new requirement I understand it might take some time to develop, but to let our management know when we can expect this fix/any timelines?

andreypotapovaspose commented 1 year ago

@karthiselvaraj, I've requested a timeline to resolve the issue from our development team. We will let you know soon.

andreypotapovaspose commented 1 year ago

@karthiselvaraj, Our developers are looking into the issue. Please consider using the following empowering approach: https://www.nuget.org/packages/Aspose.Slides.WebExtensions https://github.com/aspose-slides/Aspose.Slides.WebExtensions/ We will be waiting for your feedback.

neeraja55 commented 1 year ago

Thanks @andreypotapovaspose.

We have tested using the given approach. Seems it works with .Net framework but ours is .Net Core project and it is not supporting. Do you have any approach which supports with .Net core and meets our requirement.

karthiselvaraj commented 1 year ago

Thanks @andreypotapovaspose Our requirement is with .Net core project so looking solution with the Core project. However we tested with .Net framework and found PPT converted to HTML and has text as "text has been truncated due to evaluation version limitation." If we purchase license hope the text would be rendered same as PPT only. Please confirm.

andreypotapovaspose commented 1 year ago

@neeraja55, @karthiselvaraj, Thank you for posting your requirements. Aspose.Slides.WebExtensions should support for .NET Standard. Our developers will prepare a sample .NET Core project for you soon.

@karthiselvaraj wrote:

However we tested with .Net framework and found PPT converted to HTML and has text as "text has been truncated due to evaluation version limitation." If we purchase license hope the text would be rendered same as PPT only. Please confirm.

Yes, we confirm this.

andreypotapovaspose commented 3 months ago

@neeraja55, @karthiselvaraj, I attached the sample project. It contains the source code of the latest version of WebExtensions. S43642.ZIP Unzip the archive anywhere, and run:

> dotnet run --project <path_to_unzipped_archive>/S43642/S43642.csproj

After that, you can find the exported data here: <path_to_unzipped_archive>/out/

We have tried using the trail version of Aspose.Slides dll to convert PPTX slides to HTML. We have found all the slides converted to SVG though the PPTX not containing the SVG images. Incase if the PPTX contains SVG images its fine to have the same SVG image in the HTML . If the PPTX slides contain only text we expect the HTML output to be as div/span/paragraph elements instead of SVG which will allow us to edit the converted html. Our primary agenda is to edit the final html document and the converted HTML should support that.

You should export the presentation to HTML5.

using (Presentation pres = new Presentation("demo.pptx"))
{
   pres.Save("demo.html", SaveFormat.Html5);
}

The presentation will still contain svg elements, but they are auxiliary elements. https://docs.aspose.com/slides/net/export-to-html5/

You can use WebExtensions to apply your own templates.