@Beta public final class XSLFPictureData extends POIXMLDocumentPart
Modifier and Type | Field | Description |
---|---|---|
static int |
PICTURE_TYPE_BMP |
Windows Bitmap (.bmp)
|
static int |
PICTURE_TYPE_DIB |
Device independent bitmap
|
static int |
PICTURE_TYPE_EMF |
Extended windows meta file
|
static int |
PICTURE_TYPE_EPS |
Encapsulated Postscript (.eps)
|
static int |
PICTURE_TYPE_GIF |
GIF image format
|
static int |
PICTURE_TYPE_JPEG |
JPEG format
|
static int |
PICTURE_TYPE_PICT |
Mac PICT format
|
static int |
PICTURE_TYPE_PNG |
PNG format
|
static int |
PICTURE_TYPE_TIFF |
Tag Image File (.tiff)
|
static int |
PICTURE_TYPE_WDP |
Microsoft Windows Media Photo image (.wdp)
|
static int |
PICTURE_TYPE_WMF |
Windows Meta File
|
static int |
PICTURE_TYPE_WPG |
WordPerfect graphics (.wpg)
|
protected static POIXMLRelation[] |
RELATIONS |
Relationships for each known picture type
|
DEFAULT_XML_OPTIONS
Modifier | Constructor | Description |
---|---|---|
protected |
XSLFPictureData() |
Create a new XSLFGraphicData node
|
|
XSLFPictureData(PackagePart part,
PackageRelationship rel) |
Construct XSLFPictureData from a package part
|
Modifier and Type | Method | Description |
---|---|---|
byte[] |
getData() |
Gets the picture data as a byte array.
|
java.lang.String |
getFileName() |
Returns the file name of the image, eg image7.jpg .
|
int |
getPictureType() |
Return an integer constant that specifies type of this picture
|
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.
|
java.lang.String |
suggestFileExtension() |
Suggests a file extension for this image.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
addRelation, commit, createRelationship, createRelationship, createRelationship, getPackagePart, getPackageRelationship, getParent, getRelationById, getRelationId, getRelations, getTargetPart, onDocumentCreate, onDocumentRead, onDocumentRemove, onSave, read, rebase, removeRelation, removeRelation, toString
public static final int PICTURE_TYPE_EMF
public static final int PICTURE_TYPE_WMF
public static final int PICTURE_TYPE_PICT
public static final int PICTURE_TYPE_JPEG
public static final int PICTURE_TYPE_PNG
public static final int PICTURE_TYPE_DIB
public static final int PICTURE_TYPE_GIF
public static final int PICTURE_TYPE_TIFF
public static final int PICTURE_TYPE_EPS
public static final int PICTURE_TYPE_BMP
public static final int PICTURE_TYPE_WPG
public static final int PICTURE_TYPE_WDP
protected static final POIXMLRelation[] RELATIONS
protected XSLFPictureData()
public XSLFPictureData(PackagePart part, PackageRelationship rel)
part
- the package part holding the drawing data,rel
- the package relationship holding this drawing,
the relationship type must be http://schemas.openxmlformats.org/officeDocument/2006/relationships/imagepublic 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();
public java.lang.String getFileName()
public java.lang.String suggestFileExtension()
public int getPictureType()
protected void prepareForCommit()
prepareForCommit
in class POIXMLDocumentPart
Copyright 2018 The Apache Software Foundation or its licensors, as applicable.