Class RtfShape
- Namespace
- iTextSharp.text.rtf.graphic
- Assembly
- iTextSharp.LGPLv2.Core.dll
The RtfShape provides the interface for adding shapes to
the RTF document. This will only work for Word 97+, older
Word versions are not supported by this class.
Only very simple shapes are directly supported by the RtfShape.
For more complex shapes you will have to read the RTF
specification (iText follows the 1.6 specification) and add
the desired properties via the RtfShapeProperty.
One thing to keep in mind is that distances are not expressed
in the standard iText point, but in EMU where 1 inch = 914400 EMU
or 1 cm = 360000 EMU.
@version $Revision: 1.7 $
@author Mark Hall (Mark.Hall@mail.room3b.eu)
public class RtfShape : RtfAddableElement, IElement, IRtfBasicElement, IRtfElementInterface
- Inheritance
-
RtfShape
- Implements
- Inherited Members
Constructors
RtfShape(int, RtfShapePosition)
Constructs a new RtfShape of a given shape at the given RtfShapePosition.
public RtfShape(int type, RtfShapePosition position)
Parameters
type
intThe type of shape to create.
position
RtfShapePositionThe RtfShapePosition to create this RtfShape at.
Fields
SHAPE_ARC
Constant for an arc shape.
public const int SHAPE_ARC = 19
Field Value
SHAPE_ARROR_THICK
Constant for a thick arrow.
public const int SHAPE_ARROR_THICK = 14
Field Value
SHAPE_ARROW
Constant for an arrow.
public const int SHAPE_ARROW = 13
Field Value
SHAPE_BALLOON
Constant for a balloon shape.
public const int SHAPE_BALLOON = 17
Field Value
SHAPE_CAN
Constant for a can shape.
public const int SHAPE_CAN = 22
Field Value
SHAPE_CUBE
Constant for a cube shape.
public const int SHAPE_CUBE = 16
Field Value
SHAPE_DIAMOND
Constant for a diamond.
public const int SHAPE_DIAMOND = 4
Field Value
SHAPE_DONUT
Constant for a donut shape.
public const int SHAPE_DONUT = 23
Field Value
SHAPE_ELLIPSE
Constant for an ellipse. Use this to create circles.
public const int SHAPE_ELLIPSE = 3
Field Value
SHAPE_FREEFORM
Constant for a free form shape. The shape verticies must be specified with an array of Point objects in a RtfShapeProperty with the name PROPERTY_VERTICIES.
public const int SHAPE_FREEFORM = 0
Field Value
SHAPE_HEXAGON
Constant for a hexagon.
public const int SHAPE_HEXAGON = 9
Field Value
SHAPE_HOME_PLATE
Constant for a home plate style shape.
public const int SHAPE_HOME_PLATE = 15
Field Value
SHAPE_LINE
Constant for a line shape.
public const int SHAPE_LINE = 20
Field Value
SHAPE_OCTAGON
Constant for an ocatagon.
public const int SHAPE_OCTAGON = 10
Field Value
SHAPE_PARALLELOGRAM
Constant for a parallelogram.
public const int SHAPE_PARALLELOGRAM = 7
Field Value
SHAPE_PICTURE_FRAME
Constant for a Picture Frame.
public const int SHAPE_PICTURE_FRAME = 75
Field Value
SHAPE_RECTANGLE
Constant for a rectangle.
public const int SHAPE_RECTANGLE = 1
Field Value
SHAPE_ROUND_RECTANGLE
Constant for a rounded rectangle. The roundness is set via a RtfShapeProperty with the name PROPERTY_ADJUST_VALUE.
public const int SHAPE_ROUND_RECTANGLE = 2
Field Value
SHAPE_SEAL
Constant for a seal shape.
public const int SHAPE_SEAL = 18
Field Value
SHAPE_STAR
Constant for a star.
public const int SHAPE_STAR = 12
Field Value
SHAPE_TRAPEZOID
Constant for a trapezoid.
public const int SHAPE_TRAPEZOID = 8
Field Value
SHAPE_TRIANGLE_ISOSCELES
Constant for a isoscelle triangle.
public const int SHAPE_TRIANGLE_ISOSCELES = 5
Field Value
SHAPE_TRIANGLE_RIGHT
Constant for a right triangle.
public const int SHAPE_TRIANGLE_RIGHT = 6
Field Value
SHAPE_WRAP_BOTH
Text is wrapped on the left and right side.
public const int SHAPE_WRAP_BOTH = 2
Field Value
SHAPE_WRAP_LARGEST
Text is wrapped on the largest side.
public const int SHAPE_WRAP_LARGEST = 5
Field Value
SHAPE_WRAP_LEFT
Text is wrapped on the left side.
public const int SHAPE_WRAP_LEFT = 3
Field Value
SHAPE_WRAP_NONE
Text is not wrapped around the shape.
public const int SHAPE_WRAP_NONE = 0
Field Value
SHAPE_WRAP_RIGHT
Text is wrapped on the right side.
public const int SHAPE_WRAP_RIGHT = 4
Field Value
SHAPE_WRAP_THROUGH
Text is wrapped through the shape.
public const int SHAPE_WRAP_THROUGH = 10
Field Value
SHAPE_WRAP_TIGHT_BOTH
Text is tightly wrapped on the left and right side.
public const int SHAPE_WRAP_TIGHT_BOTH = 6
Field Value
SHAPE_WRAP_TIGHT_LARGEST
Text is tightly wrapped on the largest side.
public const int SHAPE_WRAP_TIGHT_LARGEST = 9
Field Value
SHAPE_WRAP_TIGHT_LEFT
Text is tightly wrapped on the left side.
public const int SHAPE_WRAP_TIGHT_LEFT = 7
Field Value
SHAPE_WRAP_TIGHT_RIGHT
Text is tightly wrapped on the right side.
public const int SHAPE_WRAP_TIGHT_RIGHT = 8
Field Value
SHAPE_WRAP_TOP_BOTTOM
Text is wrapped to the top and bottom.
public const int SHAPE_WRAP_TOP_BOTTOM = 1
Field Value
Methods
SetProperty(RtfShapeProperty)
Sets a property.
public void SetProperty(RtfShapeProperty property)
Parameters
property
RtfShapePropertyThe property to set for this RtfShape.
SetShapeText(string)
Sets the text to display in this RtfShape.
public void SetShapeText(string shapeText)
Parameters
shapeText
stringThe text to display.
SetWrapping(int)
Set the wrapping mode.
public void SetWrapping(int wrapping)
Parameters
wrapping
intThe wrapping mode to use for this RtfShape.
WriteContent(Stream)
Writes the RtfShape. Some settings are automatically translated into or require other properties and these are set first.
public override void WriteContent(Stream outp)
Parameters
outp
Stream