public final class ImageConverter
extends java.lang.Object
BinaryGraphicsDocument
.
The image converter can be configured as destructive. In this case, the returned
graphics documents will contain the only reference to the image (the original data
will be removed).Constructor and Description |
---|
ImageConverter(OfficeReader ofr,
boolean bDestructive,
boolean bExtractEPS)
Construct a new
ImageConverter referring to a specific document |
Modifier and Type | Method and Description |
---|---|
void |
addAcceptedFormat(java.lang.String sMime)
Define an accepted graphics format
|
BinaryGraphicsDocument |
getImage(org.w3c.dom.Element node)
Get an image from a
draw:image element. |
void |
setAcceptOtherFormats(boolean b)
Specify that the
ImageConverter should return an image even if it was not possible
to convert it to an acceptable format. |
void |
setBaseFileName(java.lang.String sBaseFileName)
Define the base file name to use for generating file names
|
void |
setDefaultFormat(java.lang.String sMime)
Define the default format for raster graphics
|
void |
setDefaultVectorFormat(java.lang.String sMime)
Define the default format for vector graphics
|
void |
setGraphicConverter(GraphicConverter gcv)
Define the
GraphicConverter to use for image conversion |
void |
setUseSubdir(java.lang.String sSubDirName)
Define the name of a sub directory to prepend to file names
|
public ImageConverter(OfficeReader ofr, boolean bDestructive, boolean bExtractEPS)
ImageConverter
referring to a specific documentofr
- the office reader to usebExtractEPS
- set true if EPS content should be extracted from SVM filespublic void setBaseFileName(java.lang.String sBaseFileName)
sBaseFileName
- the base file namepublic void setUseSubdir(java.lang.String sSubDirName)
sSubDirName
- the sub directorypublic void setAcceptOtherFormats(boolean b)
ImageConverter
should return an image even if it was not possible
to convert it to an acceptable format.b
- true if other formats should be acceptedpublic void setDefaultFormat(java.lang.String sMime)
sMime
- the MIME type of the default raster formatpublic void setDefaultVectorFormat(java.lang.String sMime)
sMime
- the MIME type for the default vector formatpublic void addAcceptedFormat(java.lang.String sMime)
sMime
- the MIME type of the formatpublic void setGraphicConverter(GraphicConverter gcv)
GraphicConverter
to use for image conversiongcv
- the graphics converterpublic BinaryGraphicsDocument getImage(org.w3c.dom.Element node)
draw:image
element. If the converter is destructive, the returned
BinaryGraphicsDocument
will hold the only reference to the image data (the original
data will be removed).node
- the image element