org.apache.poi.xslf.usermodel
Class XSLFPictureData
- java.lang.Object
-
- org.apache.poi.POIXMLDocumentPart
-
- org.apache.poi.xslf.usermodel.XSLFPictureData
-
@Beta public final class XSLFPictureData extends POIXMLDocumentPart
Instantiates sub-classes of POIXMLDocumentPart depending on their relationship type
-
-
Field Summary
Fields Modifier and Type Field and Description static intPICTURE_TYPE_BMPWindows Bitmap (.bmp)static intPICTURE_TYPE_DIBDevice independent bitmapstatic intPICTURE_TYPE_EMFExtended windows meta filestatic intPICTURE_TYPE_EPSEncapsulated Postscript (.eps)static intPICTURE_TYPE_GIFGIF image formatstatic intPICTURE_TYPE_JPEGJPEG formatstatic intPICTURE_TYPE_PICTMac PICT formatstatic intPICTURE_TYPE_PNGPNG formatstatic intPICTURE_TYPE_TIFFTag Image File (.tiff)static intPICTURE_TYPE_WDPMicrosoft Windows Media Photo image (.wdp)static intPICTURE_TYPE_WMFWindows Meta Filestatic intPICTURE_TYPE_WPGWordPerfect graphics (.wpg)-
Fields inherited from class org.apache.poi.POIXMLDocumentPart
DEFAULT_XML_OPTIONS
-
-
Constructor Summary
Constructors Constructor and Description XSLFPictureData(PackagePart part, PackageRelationship rel)Construct XSLFPictureData from a package part
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description byte[]getData()Gets the picture data as a byte array.java.lang.StringgetFileName()Returns the file name of the image, eg image7.jpg .intgetPictureType()Return an integer constant that specifies type of this picturejava.lang.StringsuggestFileExtension()Suggests a file extension for this image.-
Methods inherited from class org.apache.poi.POIXMLDocumentPart
addRelation, createRelationship, createRelationship, getPackagePart, getPackageRelationship, getParent, getRelationById, getRelationId, getRelations, toString
-
-
-
-
Field Detail
-
PICTURE_TYPE_EMF
public static final int PICTURE_TYPE_EMF
Extended windows meta file- See Also:
- Constant Field Values
-
PICTURE_TYPE_WMF
public static final int PICTURE_TYPE_WMF
Windows Meta File- See Also:
- Constant Field Values
-
PICTURE_TYPE_PICT
public static final int PICTURE_TYPE_PICT
Mac PICT format- See Also:
- Constant Field Values
-
PICTURE_TYPE_JPEG
public static final int PICTURE_TYPE_JPEG
JPEG format- See Also:
- Constant Field Values
-
PICTURE_TYPE_PNG
public static final int PICTURE_TYPE_PNG
PNG format- See Also:
- Constant Field Values
-
PICTURE_TYPE_DIB
public static final int PICTURE_TYPE_DIB
Device independent bitmap- See Also:
- Constant Field Values
-
PICTURE_TYPE_GIF
public static final int PICTURE_TYPE_GIF
GIF image format- See Also:
- Constant Field Values
-
PICTURE_TYPE_TIFF
public static final int PICTURE_TYPE_TIFF
Tag Image File (.tiff)- See Also:
- Constant Field Values
-
PICTURE_TYPE_EPS
public static final int PICTURE_TYPE_EPS
Encapsulated Postscript (.eps)- See Also:
- Constant Field Values
-
PICTURE_TYPE_BMP
public static final int PICTURE_TYPE_BMP
Windows Bitmap (.bmp)- See Also:
- Constant Field Values
-
PICTURE_TYPE_WPG
public static final int PICTURE_TYPE_WPG
WordPerfect graphics (.wpg)- See Also:
- Constant Field Values
-
PICTURE_TYPE_WDP
public static final int PICTURE_TYPE_WDP
Microsoft Windows Media Photo image (.wdp)- See Also:
- Constant Field Values
-
-
Constructor Detail
-
XSLFPictureData
public XSLFPictureData(PackagePart part, PackageRelationship rel)
Construct XSLFPictureData from a package part- Parameters:
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/image
-
-
Method Detail
-
getData
public byte[] getData()
Gets the picture data as a byte array.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();- Returns:
- the Picture data.
-
getFileName
public java.lang.String getFileName()
Returns the file name of the image, eg image7.jpg . The original filename isn't always available, but if it can be found it's likely to be in the CTDrawing
-
suggestFileExtension
public java.lang.String suggestFileExtension()
Suggests a file extension for this image.- Returns:
- the file extension.
-
getPictureType
public int getPictureType()
Return an integer constant that specifies type of this picture- Returns:
- an integer constant that specifies type of this picture
-
-
DataMelt 3.0 © DataMelt by jWork.ORG