Page 1 of 1

XHTMLtoPPTX.convertSingleSlide example

PostPosted: Sat Nov 30, 2013 3:13 am
by wingmaster

I want to import a HTML-String (with a list, bold and sublined text, etc.) into a pptx-slide and I think the convertSingleSlide methode is the one I need. But I'm having trouble using it the right way. I would really appreciate if someone can provide an example how to use the method. Looking into the source code didn't help me :-(.

Thanks in advance.


Re: XHTMLtoPPTX.convertSingleSlide example

PostPosted: Tue Dec 03, 2013 6:08 pm
by wingmaster
Okay, got it working now. My problem was the empty result, which is generated for the following html String:
Code: Select all
<ul> <li>first</li>  <li>second</li></ul>

An example migth be:
Code: Select all
String html = "<body><p><strong>bold</strong></p><p><em>italic</em></p><p><span>sublined</span></p><ul><li>listitem1</li><li>listitem2</li></ul><p>abc</p><ol><li>firstitem</li><li>seconditem</li></ol></body>"
SlidePart htmlSlide = getHTMLSlide();
PresentationMLPackage pptxFile = getPPTXFile();

XHTMLtoPPTX.convertSingleSlide(html, null, pptxFile, htmlSlide);

Key is the term "well formed XHTML". You should test yor xhtml before you call the convert method (e.g. with notepad++ and XML Tools plugin).

Re: XHTMLtoPPTX.convertSingleSlide example

PostPosted: Wed Jul 24, 2019 3:04 am
by aashish
@Jason / @wingmaster

The solution didn't work for me. it does not transform HTML list <ol> into PPTX bullets. Please refer the attached screenshot.

Code: Select all
List<Object> shapeList = XHTMLtoPPTX.convertSingleSlide(htmlText,null, presentationMLPackage, slidePart);

Am I missing anything?