Class RtfImage
java.lang.Object
com.lowagie.text.rtf.RtfElement
com.lowagie.text.rtf.graphic.RtfImage
- All Implemented Interfaces:
RtfBasicElement
The RtfImage contains one image. Supported image types are jpeg, png, wmf, bmp.
- Version:
- $Id: RtfImage.java 4065 2009-09-16 23:09:11Z psoares33 $
- Author:
- Mark Hall (Mark.Hall@mail.room3b.eu), Paulo Soares, Thomas Bickel (tmb99@inode.at)
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final byte[]lookup table used for converting bytes to hex chars.Fields inherited from class RtfElement
document, inHeader, inTableFields inherited from interface RtfBasicElement
CLOSE_GROUP, COMMA_DELIMITER, DELIMITER, OPEN_GROUP, TWIPS_FACTOR -
Constructor Summary
ConstructorsConstructorDescriptionRtfImage(RtfDocument doc, com.lowagie.text.Image image) Constructs a RtfImage for an Image. -
Method Summary
Modifier and TypeMethodDescriptionvoidsetAlignment(int alignment) Sets the alignment of this RtfImage.voidsetTopLevelElement(boolean topLevelElement) Set whether this RtfImage should behave like a top level element and enclose itself in a paragraph.voidwriteContent(OutputStream result) Writes the RtfImage contentMethods inherited from class RtfElement
intToByteArray, isInTable, setInHeader, setInTable, setRtfDocument
-
Field Details
-
byte2charLUT
public static final byte[] byte2charLUTlookup table used for converting bytes to hex chars. TODO Should probably be refactored into a helper class
-
-
Constructor Details
-
RtfImage
public RtfImage(RtfDocument doc, com.lowagie.text.Image image) throws com.lowagie.text.DocumentException Constructs a RtfImage for an Image.- Parameters:
doc- The RtfDocument this RtfImage belongs toimage- The Image that this RtfImage wraps- Throws:
com.lowagie.text.DocumentException- If an error occurred accessing the image content
-
-
Method Details
-
writeContent
Writes the RtfImage content- Specified by:
writeContentin interfaceRtfBasicElement- Specified by:
writeContentin classRtfElement- Parameters:
result- TheOutputStreamto write the content to- Throws:
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.
-