Class XSLFPictureShape

    • Method Detail

      • isExternalLinkedPicture

        public boolean isExternalLinkedPicture()
        Is this an internal picture (image data included within the PowerPoint file), or an external linked picture (image lives outside)?
      • getPictureLink

        public java.net.URI getPictureLink()
        For an external linked picture, return the last-seen path to the picture. For an internal picture, returns null.
      • getClipping

        public java.awt.Insets getClipping()
        Description copied from interface: PictureShape
        Returns the clipping values as percent ratio relatively to the image size. The clipping are returned as insets converted/scaled to 100000 (=100%).
        Specified by:
        getClipping in interface PictureShape<XSLFShape,​XSLFTextParagraph>
        Returns:
        the clipping rectangle, which is given in percent in relation to the image width/height
      • setSvgImage

        public void setSvgImage​(XSLFPictureData svgPic)
        Add a SVG image reference
        Parameters:
        svgPic - a previously imported svg image
        Since:
        POI 4.1.0
      • getName

        public java.lang.String getName()
        Returns:
        picture name, can be null
        Since:
        POI 5.1.0
      • setName

        public boolean setName​(java.lang.String name)
        Parameters:
        name - picture name
        Returns:
        returns true if the name was set
        Since:
        POI 5.1.0
      • getSvgImage

        public XSLFPictureData getSvgImage()
        Returns:
        SVG image data -- can return null if no SVG image is found
      • addSvgImage

        public static XSLFPictureShape addSvgImage​(XSLFSheet sheet,
                                                   XSLFPictureData svgPic,
                                                   PictureData.PictureType previewType,
                                                   java.awt.geom.Rectangle2D anchor)
                                            throws java.io.IOException
        Convenience method for adding SVG images, which generates the preview image
        Parameters:
        sheet - the sheet to add
        svgPic - the svg picture to add
        previewType - the preview picture type or null (defaults to PNG) - currently only JPEG,GIF,PNG are allowed
        anchor - the image anchor (for calculating the preview image size) or null (the preview size is taken from the svg picture bounds)
        Throws:
        java.io.IOException
        Since:
        POI 4.1.0
      • isVideoFile

        public boolean isVideoFile()
        Returns:
        boolean; true if the picture is a video
        Since:
        POI 5.2.0
      • getVideoFileLink

        public java.lang.String getVideoFileLink()
        Returns:
        the link ID for the video file
        Since:
        POI 5.2.0