public class XSSFPictureData extends org.apache.poi.ooxml.POIXMLDocumentPart implements PictureData
| Modifier and Type | Method and Description |
|---|---|
byte[] |
getData()
Gets the picture data as a byte array.
|
String |
getMimeType()
Returns the mime type for the image
|
int |
getPictureType()
Return an integer constant that specifies type of this picture
|
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 byte[] getData()
Note, that this call might be expensive since all the picture data is copied into a temporary byte array.
You can grab the picture data directly from the underlying package part as follows:
InputStream is = getPackagePart().getInputStream();
getData in interface PictureDatapublic String suggestFileExtension()
suggestFileExtension in interface PictureDatapublic int getPictureType()
getPictureType in interface PictureDataWorkbook.PICTURE_TYPE_EMF,
Workbook.PICTURE_TYPE_WMF,
Workbook.PICTURE_TYPE_PICT,
Workbook.PICTURE_TYPE_JPEG,
Workbook.PICTURE_TYPE_PNG,
Workbook.PICTURE_TYPE_DIBpublic String getMimeType()
PictureDatagetMimeType in interface PictureDataCopyright © 2010 - 2020 Adobe. All Rights Reserved