Table of Contents

Class RtfDocument

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

The RtfDocument stores all document related data and also the main data stream. INTERNAL CLASS - NOT TO BE USED DIRECTLY @author Mark Hall (Mark.Hall@mail.room3b.eu) @author Todd Bush (Todd.Bush@canopysystems.com) [Tab support]

public class RtfDocument : RtfElement, IRtfBasicElement, IRtfElementInterface
Inheritance
RtfDocument
Implements
Inherited Members

Constructors

RtfDocument()

The default constructor for a RtfDocument

public RtfDocument()

Methods

Add(IRtfBasicElement)

Adds an element to the rtf document

public void Add(IRtfBasicElement element)

Parameters

element IRtfBasicElement

The element to add

FilterSpecialChar(Stream, string, bool, bool)

Writes the given string to the given {@link Stream} encoding the string characters. @throws IOException

public void FilterSpecialChar(Stream outp, string str, bool useHex, bool softLineBreaks)

Parameters

outp Stream

destination Stream

str string

string to write

useHex bool

if true hex encoding characters is preferred to unicode encoding if possible

softLineBreaks bool

if true return characters are written as soft line breaks

GetAutogenerateTocEntries()

Get whether to autmatically generate table of contents entries

public bool GetAutogenerateTocEntries()

Returns

bool

Wheter to automatically generate TOC entries

GetDocumentHeader()

Gets the RtfDocumentHeader of this RtfDocument

public RtfDocumentHeader GetDocumentHeader()

Returns

RtfDocumentHeader

The RtfDocumentHeader of this RtfDocument

GetDocumentSettings()

Gets the RtfDocumentSettings that specify how the rtf document is generated.

public RtfDocumentSettings GetDocumentSettings()

Returns

RtfDocumentSettings

The current RtfDocumentSettings.

GetLastElementWritten()

Gets the last RtfBasicElement that was directly added to the RtfDocument.

public IRtfBasicElement GetLastElementWritten()

Returns

IRtfBasicElement

The last RtfBasicElement that was directly added to the RtfDocument.

GetMapper()

Gets the RtfMapper object of this RtfDocument

public RtfMapper GetMapper()

Returns

RtfMapper

The RtfMapper

GetRandomInt()

Generates a random integer that is unique with respect to the document.

public int GetRandomInt()

Returns

int

A random int

Open()

Opens the RtfDocument and initialises the data cache. If the data cache is set to CACHE_DISK, but the cache cannot be initialised then the memory cache is used.

public void Open()

OutputDebugLinebreak(Stream)

Helper method outputs linebreak in document if debugging is turned on. @throws IOException @since 2.1.3

public void OutputDebugLinebreak(Stream result)

Parameters

result Stream

the OutputStream to write the linebreak to.

SetAutogenerateTocEntries(bool)

Whether to automagically generate table of contents entries when adding Chapters or Sections.

public void SetAutogenerateTocEntries(bool autogenerate)

Parameters

autogenerate bool

Whether to automatically generate TOC entries

WriteContent(Stream)

unused

public override void WriteContent(Stream outp)

Parameters

outp Stream

WriteDocument(Stream)

Writes the document

public void WriteDocument(Stream outs)

Parameters

outs Stream

The Stream to write the RTF document to.