Class XMLSlideShow

    • Constructor Detail

      • XMLSlideShow

        public XMLSlideShow()
      • XMLSlideShow

        public XMLSlideShow​(OPCPackage pkg)
        Parameters:
        pkg - OPC package
        Throws:
        POIXMLException - a RuntimeException that can be caused by invalid OOXML data
        java.lang.RuntimeException - a number of other runtime exceptions can be thrown, especially if there are problems with the input format
      • XMLSlideShow

        public XMLSlideShow​(java.io.InputStream is)
                     throws java.io.IOException
        Parameters:
        is - InputStream
        Throws:
        java.io.IOException - If reading data from the stream fails
        POIXMLException - a RuntimeException that can be caused by invalid OOXML data
        java.lang.RuntimeException - a number of other runtime exceptions can be thrown, especially if there are problems with the input format
    • Method Detail

      • setMaxRecordLength

        public static void setMaxRecordLength​(int length)
        Parameters:
        length - the max record length allowed for XMLSlideShow
      • getMaxRecordLength

        public static int getMaxRecordLength()
        Returns:
        the max record length allowed for XMLSlideShow
      • createSlide

        public XSLFSlide createSlide​(XSLFSlideLayout layout)
        Create a slide and initialize it from the specified layout.
        Parameters:
        layout - The layout to use for the new slide.
        Returns:
        created slide
      • createChart

        public XSLFChart createChart​(XSLFSlide slide)
        Create a blank chart on the given slide.
      • createChart

        public XSLFChart createChart()
        This method is used to create template for chart XML.
        Returns:
        Xslf chart object
        Since:
        POI 4.1.0
      • getNotesSlide

        public XSLFNotes getNotesSlide​(XSLFSlide slide)
        Return notes slide for the specified slide or create new if it does not exist yet.
      • createNotesMaster

        public void createNotesMaster()
        Create a notes master.
      • getNotesMaster

        public XSLFNotesMaster getNotesMaster()
        Return the Notes Master, if there is one. (May not be present if no notes exist)
      • getCharts

        public java.util.List<XSLFChart> getCharts()
        Return all the charts in the slideshow
      • getCommentAuthors

        public XSLFCommentAuthors getCommentAuthors()
        Returns the list of comment authors, if there is one. Will only be present if at least one slide has comments on it.
      • setSlideOrder

        public void setSlideOrder​(XSLFSlide slide,
                                  int newIndex)
        Parameters:
        newIndex - 0-based index of the slide
      • removeSlide

        public XSLFSlide removeSlide​(int index)
        Remove a slide from this presentation.
        Parameters:
        index - The slide number to remove.
        Returns:
        The slide that was removed.
        Throws:
        java.lang.RuntimeException - a number of runtime exceptions can be thrown, especially if there are problems with the input format
      • findPictureData

        public XSLFPictureData findPictureData​(byte[] pictureData)
        check if a picture with this picture data already exists in this presentation
        Specified by:
        findPictureData in interface SlideShow<XSLFShape,​XSLFTextParagraph>
        Parameters:
        pictureData - The picture data to find in the SlideShow
        Returns:
        null if picture data is not found in this slideshow
        Since:
        3.15 beta 2
      • findLayout

        public XSLFSlideLayout findLayout​(java.lang.String name)
        Scan the master slides for the first slide layout with the given name.
        Parameters:
        name - The layout name (case-insensitive). Cannot be null.
        Returns:
        the first layout found or null on failure
      • addFont

        public XSLFFontInfo addFont​(java.io.InputStream fontStream)
                             throws java.io.IOException
        Description copied from interface: SlideShow
        Add an EOT font to the slideshow. An EOT or MTX font is a transformed True-Type (.ttf) or Open-Type (.otf) font. To transform a True-Type font use the sfntly library (see "see also" below)

        (Older?) Powerpoint versions handle embedded fonts by converting them to .ttf files and put them into the Windows fonts directory. If the user is not allowed to install fonts, the slideshow can't be opened. While the slideshow is opened, its possible to copy the extracted .ttfs from the fonts directory. When the slideshow is closed, they will be removed.

        Specified by:
        addFont in interface SlideShow<XSLFShape,​XSLFTextParagraph>
        Parameters:
        fontStream - the EOT font as stream
        Returns:
        the font info object containing the new font data
        Throws:
        java.io.IOException - if the fontData can't be saved or if the fontData is no EOT font
        See Also:
        EOT specification, googles sfntly library, Example on how to subset and embed fonts