@Beta public final class XSLFPictureData extends org.apache.poi.ooxml.POIXMLDocumentPart implements PictureData
org.apache.poi.ooxml.POIXMLDocumentPart.RelationPartPictureData.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, toStringpublic XSLFPictureData(PackagePart part)
part - the package part holding the drawing datapublic InputStream getInputStream() throws IOException
IOExceptionpublic byte[] getData()
getInputStream() methodgetData in interface PictureDatapublic String getFileName()
public String suggestFileExtension()
public byte[] getChecksum()
PictureDatagetChecksum in interface PictureDatapublic Dimension getImageDimension()
PictureDatagetImageDimension in interface PictureDatapublic Dimension getImageDimensionInPixels()
PictureDatagetImageDimensionInPixels in interface PictureDataPictureData.getImageDimension()public String getContentType()
PictureDatagetContentType in interface PictureDatapublic void setData(byte[] data)
throws IOException
PictureDatasetData in interface PictureDatadata - picture dataIOExceptionpublic PictureData.PictureType getType()
getType in interface PictureDatapublic 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