@Beta public final class XSLFPictureData extends POIXMLDocumentPart implements PictureData
POIXMLDocumentPart.RelationPartPictureData.PictureType| Modifier | Constructor and Description |
|---|---|
protected |
XSLFPictureData()
Create a new XSLFGraphicData node
|
|
XSLFPictureData(PackagePart part)
Construct XSLFPictureData from a package part
|
| Modifier and Type | Method and Description |
|---|---|
protected void |
cacheProperties()
Determine and cache image properties
|
byte[] |
getChecksum() |
String |
getContentType() |
byte[] |
getData()
Gets the picture data as a byte array.
|
String |
getFileName()
Returns the file name of the image, eg image7.jpg .
|
Dimension |
getImageDimension() |
Dimension |
getImageDimensionInPixels() |
int |
getIndex() |
InputStream |
getInputStream()
An InputStream to read the picture data directly
from the underlying package part
|
PictureData.PictureType |
getType() |
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.
|
void |
setData(byte[] data) |
void |
setIndex(int index) |
String |
suggestFileExtension()
Suggests a file extension for this image.
|
_invokeOnDocumentRead, addRelation, commit, createRelationship, createRelationship, createRelationship, getNextPartNumber, getPackagePart, getParent, getRelationById, getRelationId, getRelationPartById, getRelationParts, getRelations, getTargetPart, isCommitted, onDocumentCreate, onDocumentRead, onDocumentRemove, onSave, read, rebase, removeRelation, removeRelation, removeRelation, setCommitted, toStringprotected XSLFPictureData()
public 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()
getChecksum in interface PictureDatapublic Dimension getImageDimension()
getImageDimension in interface PictureDatapublic Dimension getImageDimensionInPixels()
getImageDimensionInPixels in interface PictureDataprotected void cacheProperties()
protected void prepareForCommit()
prepareForCommit in class POIXMLDocumentPartpublic String getContentType()
getContentType in interface PictureDatapublic void setData(byte[] data)
throws IOException
setData in interface PictureDataIOExceptionpublic 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 parts