@Beta public final class XSLFPictureData extends org.apache.poi.ooxml.POIXMLDocumentPart implements PictureData
org.apache.poi.ooxml.POIXMLDocumentPart.RelationPart
PictureData.PictureType
Constructor and Description |
---|
XSLFPictureData(PackagePart part)
Construct XSLFPictureData from a package part
|
Modifier and Type | Method and Description |
---|---|
byte[] |
getChecksum()
Gets the checksum - the checksum can be of various length -
mostly it's 8 (XSLF) or 16 (HSLF) bytes long.
|
String |
getContentType()
Returns content type (mime type) of this picture.
|
byte[] |
getData()
Gets the picture data as a byte array.
|
String |
getFileName()
Returns the file name of the image, eg image7.jpg .
|
Dimension |
getImageDimension()
Return the original image dimensions in points
(for formats supported by BufferedImage).
|
Dimension |
getImageDimensionInPixels()
Return the original image dimensions in pixels
|
int |
getIndex() |
InputStream |
getInputStream()
An InputStream to read the picture data directly
from the underlying package part
|
PictureData.PictureType |
getType() |
void |
setData(byte[] data)
Sets the binary picture data
|
void |
setIndex(int index) |
String |
suggestFileExtension()
Suggests a file extension for this image.
|
_invokeOnDocumentRead, addRelation, createRelationship, createRelationship, createRelationship, getPackagePart, getParent, getRelationById, getRelationId, getRelationPartById, getRelationParts, getRelations, isCommited, isCommitted, setCommited, setCommitted, toString
public XSLFPictureData(PackagePart part)
part
- the package part holding the drawing datapublic InputStream getInputStream() throws IOException
IOException
public byte[] getData()
getInputStream()
methodgetData
in interface PictureData
public String getFileName()
public String suggestFileExtension()
public byte[] getChecksum()
PictureData
getChecksum
in interface PictureData
public Dimension getImageDimension()
PictureData
getImageDimension
in interface PictureData
public Dimension getImageDimensionInPixels()
PictureData
getImageDimensionInPixels
in interface PictureData
PictureData.getImageDimension()
public String getContentType()
PictureData
getContentType
in interface PictureData
public void setData(byte[] data) throws IOException
PictureData
setData
in interface PictureData
data
- picture dataIOException
public PictureData.PictureType getType()
getType
in interface PictureData
public int getIndex()
public void setIndex(int index)
index
- sets the 0-based index of this pictures within the picture partsCopyright © 2010 - 2020 Adobe. All Rights Reserved