The emf, jpg & png image will not be displayed in correct size
|
Field Summary |
protected int |
graphicCompressionRate
Graphic compression rate |
protected int |
height
The height of the image |
protected int |
heightDesired
The desired height |
protected int |
heightPercent
The desired percent value of the height |
protected boolean |
perCentH
Flag whether the desired height is a percentage |
protected boolean |
perCentW
Flag whether the desired width is a percentage |
protected boolean |
scaleUniform
Flag whether the image size shall be adjusted |
protected java.net.URL |
url
The url of the image |
protected int |
width
The width of the image |
protected int |
widthDesired
The desired width |
protected int |
widthPercent
The desired percent value of the width |
|
Method Summary |
private int |
determineImageType(byte[] data,
java.lang.String ext)
Determine image file format. |
int |
getCompressionRate()
Gets the compression rate for the image in percent. |
private boolean |
isBMP(byte[] data)
Determines wheter the image is a gif. |
private boolean |
isEMF(byte[] data)
Determines wheter the image is a emf. |
boolean |
isEmpty()
true if this element would generate no "useful" RTF content |
private boolean |
isGIF(byte[] data)
Determines wheter the image is a gif. |
private boolean |
isJPEG(byte[] data)
Determines wheter the image is a jpeg. |
private boolean |
isPNG(byte[] data)
Determines wheter the image is a png. |
boolean |
setCompressionRate(int percent)
Sets the compression rate for the image in percent. |
void |
setHeight(java.lang.String theHeight)
Sets the desired height of the image. |
void |
setScaling(java.lang.String value)
Sets the flag whether the image size shall be adjusted. |
void |
setURL(java.lang.String urlString)
Sets the url of the image. |
void |
setWidth(java.lang.String theWidth)
Sets the desired width of the image. |
protected void |
writeRtfContent()
RtfElement override - catches ExternalGraphicException and writes a warning
message to the document if image cannot be read |
protected void |
writeRtfContentWithException()
Writes the RTF content to m_writer - this one throws ExternalGraphicExceptions |
| Methods inherited from class org.jfor.jfor.rtflib.rtfdoc.RtfElement |
close, dump, getParentOfClass, getRtfAttributes, getRtfFile, isClosed, okToWriteRtf, toString, writeAttributes, writeControlWord, writeControlWordNS, writeExceptionInRtf, writeGroupMark, writeOneAttribute, writeOneAttributeNS, writeRtf, writeRtfPrefix, writeRtfSuffix, writeStarControlWord, writeStarControlWordNS |
url
protected java.net.URL url
- The url of the image
height
protected int height
- The height of the image
heightPercent
protected int heightPercent
- The desired percent value of the height
heightDesired
protected int heightDesired
- The desired height
perCentH
protected boolean perCentH
- Flag whether the desired height is a percentage
width
protected int width
- The width of the image
widthPercent
protected int widthPercent
- The desired percent value of the width
widthDesired
protected int widthDesired
- The desired width
perCentW
protected boolean perCentW
- Flag whether the desired width is a percentage
scaleUniform
protected boolean scaleUniform
- Flag whether the image size shall be adjusted
graphicCompressionRate
protected int graphicCompressionRate
- Graphic compression rate
RtfExternalGraphic
public RtfExternalGraphic(RtfContainer container,
java.io.Writer writer)
throws java.io.IOException
- Default constructor.
Create an RTF element as a child of given container.
RtfExternalGraphic
public RtfExternalGraphic(RtfContainer container,
java.io.Writer writer,
RtfAttributes attributes)
throws java.io.IOException
- Default constructor.
writeRtfContent
protected void writeRtfContent()
throws java.io.IOException
- RtfElement override - catches ExternalGraphicException and writes a warning
message to the document if image cannot be read
- Specified by:
writeRtfContent in class RtfElement
writeRtfContentWithException
protected void writeRtfContentWithException()
throws java.io.IOException
- Writes the RTF content to m_writer - this one throws ExternalGraphicExceptions
setHeight
public void setHeight(java.lang.String theHeight)
- Sets the desired height of the image.
setWidth
public void setWidth(java.lang.String theWidth)
- Sets the desired width of the image.
setScaling
public void setScaling(java.lang.String value)
- Sets the flag whether the image size shall be adjusted.
setURL
public void setURL(java.lang.String urlString)
throws java.io.IOException
- Sets the url of the image.
getCompressionRate
public int getCompressionRate()
- Gets the compression rate for the image in percent.
setCompressionRate
public boolean setCompressionRate(int percent)
- Sets the compression rate for the image in percent.
isJPEG
private boolean isJPEG(byte[] data)
- Determines wheter the image is a jpeg.
isPNG
private boolean isPNG(byte[] data)
- Determines wheter the image is a png.
isEMF
private boolean isEMF(byte[] data)
- Determines wheter the image is a emf.
isGIF
private boolean isGIF(byte[] data)
- Determines wheter the image is a gif.
isBMP
private boolean isBMP(byte[] data)
- Determines wheter the image is a gif.
determineImageType
private int determineImageType(byte[] data,
java.lang.String ext)
- Determine image file format.
isEmpty
public boolean isEmpty()
- true if this element would generate no "useful" RTF content
- Specified by:
isEmpty in class RtfElement