Class RtfParagraphStyle
- Namespace
- iTextSharp.text.rtf.style
- Assembly
- iTextSharp.LGPLv2.Core.dll
The RtfParagraphStyle stores all style/formatting attributes of a RtfParagraph. Additionally it also supports the style name system available in RTF. The RtfParagraphStyle is a Font and can thus be used as such. To use the stylesheet functionality it needs to be set as the font of a Paragraph. Otherwise it will work like a RtfFont. It also supports inheritance of styles. @version $Revision: 1.8 $ @author Mark Hall (Mark.Hall@mail.room3b.eu)
public class RtfParagraphStyle : RtfFont, IComparable, IRtfExtendedElement, IRtfBasicElement, IRtfElementInterface
- Inheritance
-
RtfParagraphStyle
- Implements
- Inherited Members
Constructors
RtfParagraphStyle(string, string)
Constructs a new RtfParagraphStyle that is based on an existing RtfParagraphStyle.
public RtfParagraphStyle(string styleName, string basedOnName)
Parameters
styleName
stringThe name of this RtfParagraphStyle.
basedOnName
stringThe name of the RtfParagraphStyle this RtfParagraphStyle is based on.
RtfParagraphStyle(string, string, int, int, BaseColor)
Constructs a new RtfParagraphStyle with the given attributes.
public RtfParagraphStyle(string styleName, string fontName, int fontSize, int fontStyle, BaseColor fontColor)
Parameters
styleName
stringThe name of this RtfParagraphStyle.
fontName
stringThe name of the font to use for this RtfParagraphStyle.
fontSize
intThe size of the font to use for this RtfParagraphStyle.
fontStyle
intThe style of the font to use for this RtfParagraphStyle.
fontColor
BaseColorThe colour of the font to use for this RtfParagraphStyle.
RtfParagraphStyle(RtfDocument, RtfParagraphStyle)
Constructs a RtfParagraphStyle from another RtfParagraphStyle. INTERNAL USE ONLY
public RtfParagraphStyle(RtfDocument doc, RtfParagraphStyle style)
Parameters
doc
RtfDocumentThe RtfDocument this RtfParagraphStyle belongs to.
style
RtfParagraphStyleThe RtfParagraphStyle to copy settings from.
Fields
AlignCenter
Constant for center alignment
public static readonly byte[] AlignCenter
Field Value
- byte[]
AlignJustify
Constant for justified alignment
public static readonly byte[] AlignJustify
Field Value
- byte[]
AlignLeft
Constant for left alignment
public static readonly byte[] AlignLeft
Field Value
- byte[]
AlignRight
Constant for right alignment
public static readonly byte[] AlignRight
Field Value
- byte[]
FirstLineIndent
Constant for the first line indentation
public static readonly byte[] FirstLineIndent
Field Value
- byte[]
IndentLeft
Constant for left indentation
public static readonly byte[] IndentLeft
Field Value
- byte[]
IndentRight
Constant for right indentation
public static readonly byte[] IndentRight
Field Value
- byte[]
KeepTogether
Constant for keeping the paragraph together on one page
public static readonly byte[] KeepTogether
Field Value
- byte[]
KeepTogetherWithNext
Constant for keeping the paragraph toghether with the next one on one page
public static readonly byte[] KeepTogetherWithNext
Field Value
- byte[]
SpacingAfter
Constant for the space after the paragraph.
public static readonly byte[] SpacingAfter
Field Value
- byte[]
SpacingBefore
Constant for the space before the paragraph.
public static readonly byte[] SpacingBefore
Field Value
- byte[]
StyleHeading1
The style for level 1 headings.
public static readonly RtfParagraphStyle StyleHeading1
Field Value
StyleHeading2
The style for level 2 headings.
public static readonly RtfParagraphStyle StyleHeading2
Field Value
StyleHeading3
The style for level 3 headings.
public static readonly RtfParagraphStyle StyleHeading3
Field Value
StyleNormal
The NORMAL/STANDARD style.
public static readonly RtfParagraphStyle StyleNormal
Field Value
Properties
Size
Sets the font size of this RtfParagraphStyle.
public override float Size { set; }
Property Value
Methods
Equals(object)
Tests whether two RtfParagraphStyles are equal. Equality is determined via the name.
public override bool Equals(object obj)
Parameters
obj
object
Returns
GetAlignment()
Gets the alignment of this RtfParagraphStyle.
public int GetAlignment()
Returns
- int
The alignment of this RtfParagraphStyle.
GetBasedOnName()
Gets the name of the RtfParagraphStyle this RtfParagraphStyle is based on.
public string GetBasedOnName()
Returns
- string
The name of the base RtfParagraphStyle.
GetFirstLineIndent()
Gets the first line indentation of this RtfParagraphStyle.
public int GetFirstLineIndent()
Returns
- int
The first line indentation of this RtfParagraphStyle.
GetHashCode()
Gets the hash code of this RtfParagraphStyle.
public override int GetHashCode()
Returns
GetIndentLeft()
Gets the left indentation of this RtfParagraphStyle.
public int GetIndentLeft()
Returns
- int
The left indentation of this RtfParagraphStyle.
GetIndentRight()
Gets the right indentation of this RtfParagraphStyle.
public int GetIndentRight()
Returns
- int
The right indentation of this RtfParagraphStyle.
GetKeepTogether()
Gets whether the lines in the paragraph should be kept together in this RtfParagraphStyle.
public bool GetKeepTogether()
Returns
- bool
Whether the lines in the paragraph should be kept together.
GetKeepTogetherWithNext()
Gets whether the paragraph should be kept toggether with the next in this RtfParagraphStyle.
public bool GetKeepTogetherWithNext()
Returns
- bool
Whether the paragraph should be kept together with the next.
GetLineLeading()
Gets the line leading of this RtfParagraphStyle.
public int GetLineLeading()
Returns
- int
The line leading of this RtfParagraphStyle.
GetSpacingAfter()
Gets the space after the paragraph of this RtfParagraphStyle.
public int GetSpacingAfter()
Returns
- int
The space after the paragraph.
GetSpacingBefore()
Gets the space before the paragraph of this RtfParagraphStyle..
public int GetSpacingBefore()
Returns
- int
The space before the paragraph.
GetStyleName()
Gets the name of this RtfParagraphStyle.
public string GetStyleName()
Returns
- string
The name of this RtfParagraphStyle.
HandleInheritance()
Handles the inheritance of paragraph style settings. All settings that have not been modified will be inherited from the base RtfParagraphStyle. If this RtfParagraphStyle is not based on another one, then nothing happens.
public void HandleInheritance()
SetAlignment(int)
Sets the alignment of this RtfParagraphStyle.
public void SetAlignment(int alignment)
Parameters
alignment
intThe alignment to use.
SetColor(BaseColor)
Sets the colour of this RtfParagraphStyle.
public void SetColor(BaseColor color)
Parameters
color
BaseColorThe Color to use.
SetFirstLineIndent(int)
Sets the first line indententation of this RtfParagraphStyle. It is relative to the left indentation.
public void SetFirstLineIndent(int firstLineIndent)
Parameters
firstLineIndent
intThe first line indentation to use.
SetFontName(string)
Sets the font name of this RtfParagraphStyle.
public override void SetFontName(string fontName)
Parameters
fontName
stringThe font name to use
SetIndentLeft(int)
Sets the left indentation of this RtfParagraphStyle.
public void SetIndentLeft(int indentLeft)
Parameters
indentLeft
intThe left indentation to use.
SetIndentRight(int)
Sets the right indentation of this RtfParagraphStyle.
public void SetIndentRight(int indentRight)
Parameters
indentRight
intThe right indentation to use.
SetKeepTogether(bool)
Sets whether the lines in the paragraph should be kept together in this RtfParagraphStyle.
public void SetKeepTogether(bool keepTogether)
Parameters
keepTogether
boolWhether the lines in the paragraph should be kept together.
SetKeepTogetherWithNext(bool)
Sets whether the paragraph should be kept together with the next in this RtfParagraphStyle.
public void SetKeepTogetherWithNext(bool keepTogetherWithNext)
Parameters
keepTogetherWithNext
boolWhether the paragraph should be kept together with the next.
SetLineLeading(int)
Sets the line leading of this RtfParagraphStyle.
public void SetLineLeading(int lineLeading)
Parameters
lineLeading
intThe line leading to use.
SetSpacingAfter(int)
Sets the space after the paragraph of this RtfParagraphStyle.
public void SetSpacingAfter(int spacingAfter)
Parameters
spacingAfter
intThe space after to use.
SetSpacingBefore(int)
Sets the space before the paragraph of this RtfParagraphStyle.
public void SetSpacingBefore(int spacingBefore)
Parameters
spacingBefore
intThe space before to use.
SetStyle(int)
Sets the font style of this RtfParagraphStyle.
public override void SetStyle(int style)
Parameters
style
intThe font style to use.
SetStyleNumber(int)
Sets the number of this RtfParagraphStyle in the stylesheet list.
protected void SetStyleNumber(int styleNumber)
Parameters
styleNumber
intThe number to use.
WriteBegin(Stream)
Writes the start information of this RtfParagraphStyle. @throws IOException On i/o errors.
public override void WriteBegin(Stream result)
Parameters
result
StreamThe OutputStream to write to.
WriteContent(Stream)
unused
public override void WriteContent(Stream outp)
Parameters
outp
Stream
WriteDefinition(Stream)
Writes the definition of this RtfParagraphStyle for the stylesheet list.
public override void WriteDefinition(Stream outp)
Parameters
outp
Stream
WriteEnd(Stream)
Unused
public override void WriteEnd(Stream result)
Parameters
result
Stream