My best advise is to use reverse engineering. Open PowerPoint and create a presentation with a slide. Then add notes to this slide and save in a different file. The unzip both and compare differences.
Notes is a special kind of sheet and should extend XSLFSheet. Creating new notes should follow the same pattern as creating new slides. Hope it helps. Yegor On Thu, Jun 27, 2013 at 1:07 AM, honyk <[email protected]> wrote: >> I haven't found any method for injecting any arbitrary XML code to the > result yet > > I'd like to help with implementing the functionality for adding slide notes > to the presentation... please throw me a rope... thanks. > > >> -----Original Message----- >> From: honyk [mailto:[email protected]] >> Sent: Tuesday, May 21, 2013 7:55 PM >> To: 'POI Developers List' >> Subject: RE: [XSLF] Creating slide notes >> >> Picked from another thread: >> > Technically speaking, adding support for notes in XLSF is not that >> > hard. The best way to understand how Presenatation ML does it is to >> > create two simple presentations: one without notes and the other with >> > a notes attached. Then unzip and diff the files. >> >> Let's imagine I have XML code with notes. How can I inject it into the >> slide >> using XSLF correctly? The example below fails. I haven't found any >> other >> method for injecting any arbitrary XML code to the result yet. >> >> Jan >> >> >> > -----Original Message----- >> > From: honyk [mailto:[email protected]] >> > Sent: Friday, May 10, 2013 7:44 PM >> > To: [email protected] >> > Subject: [XSLF] Creating slide notes >> > >> > Dear All, >> > >> > while the reading current notes is quite straightforward, creating >> new >> > ones >> > seems to be a challenge. >> > >> > I've cloned XSLFNotes class (=MyNotes) with one extra constructor >> > taking a >> > CTNotesSlide as a parameter. (XSLFNotes cannot be extented as it is >> > final) >> > >> > When testing this class using the following code it returns NPE: >> > >> > public static void main(String[] args) { >> > >> > try { >> > StringBuilder text = new StringBuilder(); >> > XMLSlideShow pptx = new XMLSlideShow(new >> > FileInputStream("D:/test.pptx")); >> > for (XSLFSlide slide : pptx.getSlides()) { >> > >> > MyNotes notes = new >> > MyNotes(slide.getNotes().getXmlObject()); >> > slide.addRelation("test", notes); >> > } >> > >> > FileOutputStream out = new >> > FileOutputStream("D:/test_u.pptx"); >> > pptx.write(out); >> > out.close(); >> > >> > } catch (IOException e) { >> > e.printStackTrace(); >> > } >> > } >> > >> > It reads notes which are already present and adds the second instance >> > of >> > them to the same slide. I naively expected it could just double them >> in >> > the >> > final file. >> > >> > But this happens instead: >> > >> > Exception in thread "main" java.lang.NullPointerException >> > at >> > org.apache.poi.xslf.usermodel.XSLFSheet.commit(XSLFSheet.java:282) >> > at >> > org.apache.poi.POIXMLDocumentPart.onSave(POIXMLDocumentPart.java:313) >> > at >> > org.apache.poi.POIXMLDocumentPart.onSave(POIXMLDocumentPart.java:317) >> > at >> > org.apache.poi.POIXMLDocumentPart.onSave(POIXMLDocumentPart.java:317) >> > at org.apache.poi.POIXMLDocument.write(POIXMLDocument.java:173) >> > at net.gmc.util.slidenotes.App.main(App.java:42) >> > Java Result: 1 >> > >> > It was just the proof of concept. In my case I'd like to merge raw >> PPTX >> > file >> > and an external XML file with notes grouped per slide. Notes in the >> > form of >> > simple paragraphs would be sufficient for me. >> > >> > Has anybody any experience with this area? I am willing to >> investigate >> > it, >> > but to be honest, this is the complete new thing for me so any >> > introductory >> > guidance is highly appreciated. >> > >> > Thanks, Jan >> > > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [email protected] > For additional commands, e-mail: [email protected] > --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
