com.lowagie.text.rtf.graphic
Class RtfImage
java.lang.Object
com.lowagie.text.rtf.RtfElement
com.lowagie.text.rtf.graphic.RtfImage
- All Implemented Interfaces:
- RtfBasicElement, RtfElementInterface
public class RtfImage
- extends RtfElement
The RtfImage contains one image. Supported image types are jpeg, png, wmf, bmp.
- Version:
- $Id: RtfImage.java 3580 2008-08-06 15:52:00Z howard_s $
- Author:
- Mark Hall (Mark.Hall@mail.room3b.eu), Paulo Soares, Thomas Bickel (tmb99@inode.at)
Field Summary |
static byte[] |
byte2charLUT
lookup table used for converting bytes to hex chars. |
Method Summary |
void |
setAlignment(int alignment)
Sets the alignment of this RtfImage. |
void |
setTopLevelElement(boolean topLevelElement)
Set whether this RtfImage should behave like a top level element
and enclose itself in a paragraph. |
void |
writeContent(java.io.OutputStream result)
Writes the RtfImage content |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
byte2charLUT
public static final byte[] byte2charLUT
- lookup table used for converting bytes to hex chars.
TODO Should probably be refactored into a helper class
RtfImage
public RtfImage(RtfDocument doc,
Image image)
throws DocumentException
- Constructs a RtfImage for an Image.
- Parameters:
doc
- The RtfDocument this RtfImage belongs toimage
- The Image that this RtfImage wraps
- Throws:
DocumentException
- If an error occurred accessing the image content
writeContent
public void writeContent(java.io.OutputStream result)
throws java.io.IOException
- Writes the RtfImage content
- Specified by:
writeContent
in interface RtfBasicElement
- Specified by:
writeContent
in class RtfElement
- Parameters:
result
- The OutputStream
to write the content to
- Throws:
java.io.IOException
setAlignment
public void setAlignment(int alignment)
- Sets the alignment of this RtfImage. Uses the alignments from com.lowagie.text.Element.
- Parameters:
alignment
- The alignment to use.
setTopLevelElement
public void setTopLevelElement(boolean topLevelElement)
- Set whether this RtfImage should behave like a top level element
and enclose itself in a paragraph.
- Parameters:
topLevelElement
- Whether to behave like a top level element.
iText 2.1.7