Table of Contents

Class RtfField

Namespace
iTextSharp.text.rtf.field
Assembly
iTextSharp.LGPLv2.Core.dll

The RtfField class is an abstract base class for all rtf field functionality. Subclasses only need to implement the two abstract methods writeFieldInstContent and writeFieldResultContent. All other field functionality is handled by the RtfField class. @version \(Version:\) @author Mark Hall (Mark.Hall@mail.room3b.eu) @author Dirk Weigenand

public abstract class RtfField : Chunk, IElement, IRtfBasicElement, IRtfElementInterface
Inheritance
RtfField
Implements
Derived
Inherited Members

Constructors

RtfField(RtfDocument)

Constructs a RtfField for a RtfDocument. This is not very usefull, since the RtfField by itself does not do anything. Use one of the subclasses instead.

protected RtfField(RtfDocument doc)

Parameters

doc RtfDocument

The RtfDocument this RtfField belongs to.

RtfField(RtfDocument, Font)

Constructs a RtfField for a RtfDocument. This is not very usefull, since the RtfField by itself does not do anything. Use one of the subclasses instead.

protected RtfField(RtfDocument doc, Font font)

Parameters

doc RtfDocument

The RtfDocument this RtfField belongs to.

font Font

The Font this RtfField should use

Fields

CloseGroup

Constant for the end of an rtf group

public static readonly byte[] CloseGroup

Field Value

byte[]

CommaDelimiter

Constant for a comma delimiter in rtf

public static readonly byte[] CommaDelimiter

Field Value

byte[]

Delimiter

Constant for a delimiter in rtf

public static readonly byte[] Delimiter

Field Value

byte[]

Document

The RtfDocument this RtfField belongs to

protected RtfDocument Document

Field Value

RtfDocument

OpenGroup

Constant for the beginning of a rtf group

public static readonly byte[] OpenGroup

Field Value

byte[]

TWIPS_FACTOR

The factor to use for translating from iText to rtf measurments

public const double TWIPS_FACTOR = 20

Field Value

double

Properties

Font

public override Font Font { set; }

Property Value

Font

Methods

IsEmpty()

An RtfField is never empty.

public override bool IsEmpty()

Returns

bool

IsFieldAlt()

Get whether this field is an alt field

public bool IsFieldAlt()

Returns

bool

Returns whether this field is an alt field

IsFieldDirty()

Get whether this field is dirty

public bool IsFieldDirty()

Returns

bool

Returns whether this field is dirty

IsFieldEdit()

Get whether this field is edited

public bool IsFieldEdit()

Returns

bool

Returns whether this field is edited

IsFieldLocked()

Get whether this field is locked

public bool IsFieldLocked()

Returns

bool

Returns the fieldLocked.

IsFieldPrivate()

Get whether this field is private

public bool IsFieldPrivate()

Returns

bool

Returns the fieldPrivate.

IsInHeader()

Gets whether this RtfField is in a header.

public bool IsInHeader()

Returns

bool

True if this RtfField is in a header, false otherwise

IsInTable()

Gets whether this RtfField is in a table.

public bool IsInTable()

Returns

bool

True if this RtfField is in a table, false otherwise

SetFieldAlt(bool)

Set whether this field is an alt field

public void SetFieldAlt(bool fieldAlt)

Parameters

fieldAlt bool

The value to use

SetFieldDirty(bool)

Set whether this field is dirty

public void SetFieldDirty(bool fieldDirty)

Parameters

fieldDirty bool

The value to use

SetFieldEdit(bool)

Set whether this field is edited.

public void SetFieldEdit(bool fieldEdit)

Parameters

fieldEdit bool

The value to use

SetFieldLocked(bool)

Set whether this field is locked

public void SetFieldLocked(bool fieldLocked)

Parameters

fieldLocked bool

The value to use

SetFieldPrivate(bool)

Set whether this field is private

public void SetFieldPrivate(bool fieldPrivate)

Parameters

fieldPrivate bool

The value to use

SetInHeader(bool)

Sets whether this RtfField is in a header

public void SetInHeader(bool inHeader)

Parameters

inHeader bool

True if this RtfField is in a header, false otherwise

SetInTable(bool)

Sets whether this RtfField is in a table

public void SetInTable(bool inTable)

Parameters

inTable bool

True if this RtfField is in a table, false otherwise

SetRtfDocument(RtfDocument)

Sets the RtfDocument this RtfElement belongs to

public void SetRtfDocument(RtfDocument doc)

Parameters

doc RtfDocument

The RtfDocument to use

WriteContent(Stream)

Writes the field to the OutputStream .

public virtual void WriteContent(Stream outp)

Parameters

outp Stream

WriteFieldInstContent(Stream)

Writes the content of the field instruction area. Override this method in your subclasses.

protected abstract void WriteFieldInstContent(Stream oupt)

Parameters

oupt Stream

WriteFieldResultContent(Stream)

Writes the content of the pre-calculated field result. Override this method in your subclasses.

protected abstract void WriteFieldResultContent(Stream oupt)

Parameters

oupt Stream