/* Iterate over slides and extract text */
for( Slide slide : _slides ) {
xhtml.startElement("div", "class", "slide");
// Slide header, if present
HeadersFooters hf = slide.getHeadersFooters();
if (hf != null && hf.isHeaderVisible() && hf.getHeaderText() != null) {
xhtml.startElement("p", "class", "slide-header");
xhtml.characters( hf.getHeaderText() );
xhtml.endElement("p");
}
// Slide master, if present
extractMaster(xhtml, slide.getMasterSheet());
// Slide text
{
xhtml.startElement("p", "class", "slide-content");
textRunsToText(xhtml, slide.getTextRuns());
xhtml.endElement("p");
}
// Table text
for (Shape shape: slide.getShapes()){
if (shape instanceof Table){
extractTableText(xhtml, (Table)shape);
}
}
// Slide footer, if present
if (hf != null && hf.isFooterVisible() && hf.getFooterText() != null) {
xhtml.startElement("p", "class", "slide-footer");
xhtml.characters( hf.getFooterText() );
xhtml.endElement("p");
}
// Comments, if present
for( Comment comment : slide.getComments() ) {
xhtml.startElement("p", "class", "slide-comment");
if (comment.getAuthor() != null) {
xhtml.startElement("b");
xhtml.characters( comment.getAuthor() );
xhtml.endElement("b");
if (comment.getText() != null) {
xhtml.characters( " - ");
}
}
if (comment.getText() != null) {
xhtml.characters( comment.getText() );
}
xhtml.endElement("p");
}
// Now any embedded resources
handleSlideEmbeddedResources(slide, xhtml);
// TODO Find the Notes for this slide and extract inline
// Slide complete
xhtml.endElement("div");
}
// All slides done
xhtml.endElement("div");
/* notes */
xhtml.startElement("div", "class", "slideNotes");
HashSet<Integer> seenNotes = new HashSet<Integer>();
HeadersFooters hf = _show.getNotesHeadersFooters();
for (Slide slide : _slides) {
Notes notes = slide.getNotesSheet();
if (notes == null) {
continue;
}
Integer id = notes._getSheetNumber();
if (seenNotes.contains(id)) {
continue;
}
seenNotes.add(id);
// Repeat the Notes header, if set
if (hf != null && hf.isHeaderVisible() && hf.getHeaderText() != null) {
xhtml.startElement("p", "class", "slide-note-header");
xhtml.characters( hf.getHeaderText() );
xhtml.endElement("p");
}
// Notes text
textRunsToText(xhtml, notes.getTextRuns());
// Repeat the notes footer, if set
if (hf != null && hf.isFooterVisible() && hf.getFooterText() != null) {
xhtml.startElement("p", "class", "slide-note-footer");
xhtml.characters( hf.getFooterText() );
xhtml.endElement("p");
}
}
handleSlideEmbeddedPictures(_show, xhtml);