Class XSLFPictureData

    • Constructor Detail

      • XSLFPictureData

        protected XSLFPictureData()
        Create a new XSLFGraphicData node
      • XSLFPictureData

        public XSLFPictureData​(PackagePart part)
        Construct XSLFPictureData from a package part
        Parameters:
        part - the package part holding the drawing data
        Since:
        POI 3.14-Beta1
    • Method Detail

      • setMaxImageSize

        public static void setMaxImageSize​(int length)
        Parameters:
        length - the max image size allowed for XSLF pictures
      • getMaxImageSize

        public static int getMaxImageSize()
        Returns:
        the max image size allowed for XSLF pictures
      • getInputStream

        public InputStream getInputStream()
                                   throws IOException
        An InputStream to read the picture data directly from the underlying package part
        Returns:
        InputStream
        Throws:
        IOException
      • getData

        public byte[] getData()
        Gets the picture data as a byte array. You can grab the picture data directly from the underlying package part with the getInputStream() method
        Specified by:
        getData in interface PictureData
        Returns:
        the Picture data.
      • getFileName

        public String getFileName()
        Returns the file name of the image, eg image7.jpg . The original filename isn't always available, but if it can be found it's likely to be in the CTDrawing
      • suggestFileExtension

        public String suggestFileExtension()
        Suggests a file extension for this image.
        Returns:
        the file extension.
      • cacheProperties

        protected void cacheProperties()
        Determine and cache image properties
      • prepareForCommit

        protected void prepareForCommit()
        *PictureData objects store the actual content in the part directly without keeping a copy like all others therefore we need to handle them differently.
        Overrides:
        prepareForCommit in class POIXMLDocumentPart
      • getIndex

        public int getIndex()
        Returns:
        the 0-based index of this pictures within the picture parts
      • setIndex

        public void setIndex​(int index)
        Parameters:
        index - sets the 0-based index of this pictures within the picture parts