public RtfImage(RtfDocument doc,
Image image) throws DocumentException {
super(doc);
imageType = image.getOriginalType();
if (!(imageType == Image.ORIGINAL_JPEG || imageType == Image.ORIGINAL_BMP
|| imageType == Image.ORIGINAL_PNG || imageType == Image.ORIGINAL_WMF || imageType == Image.ORIGINAL_GIF)) {
throw new DocumentException("Only BMP, PNG, WMF, GIF and JPEG images are supported by the RTF Writer");
}
alignment = image.getAlignment();
width = image.getWidth();
height = image.getHeight();
plainWidth = image.getPlainWidth();
plainHeight = image.getPlainHeight();
this.imageData = getImageData(image);
}
Constructs a RtfImage for an Image. Parameters:
doc - The RtfDocument this RtfImage belongs to
image - The Image that this RtfImage wraps
Throws:
DocumentException - If an error occurred accessing the image content
|