Table of Contents

Class RtfImportMgr

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

The RtfImportHeader stores the docment header information from an RTF document that is being imported. Currently font and color settings are stored. The RtfImportHeader maintains a mapping from font and color numbers from the imported RTF document to the RTF document that is the target of the import. This guarantees that the merged document has the correct font and color settings. It also handles other list based items that need mapping, for example stylesheets and lists. @author Mark Hall (Mark.Hall@mail.room3b.eu) @author Howard Shank (hgshank@yahoo.com)

public class RtfImportMgr
Inheritance
RtfImportMgr
Inherited Members

Constructors

RtfImportMgr(RtfDocument, Document)

Constructs a new RtfImportHeader.

public RtfImportMgr(RtfDocument rtfDoc, Document doc)

Parameters

rtfDoc RtfDocument

The RtfDocument to get font and color numbers from.

doc Document

Methods

ImportColor(string, BaseColor)

Imports a color value. The color number for the color defined by its red, green and blue values is determined and then the resulting mapping is added.

public void ImportColor(string colorNr, BaseColor color)

Parameters

colorNr string

The original color number.

color BaseColor

The color to import.

ImportFont(string, string)

Imports a font. The font name is looked up in the RtfDocumentHeader and then the mapping from original font number to actual font number is added.

public bool ImportFont(string fontNr, string fontName)

Parameters

fontNr string

The original font number.

fontName string

The font name to look up.

Returns

bool

ImportFont(string, string, int)

Imports a font. The font name is looked up in the RtfDocumentHeader and then the mapping from original font number to actual font number is added.

public bool ImportFont(string fontNr, string fontName, int charset)

Parameters

fontNr string

The original font number.

fontName string

The font name to look up.

charset int

The characterset to use for the font.

Returns

bool

ImportFont(string, string, string, int)

Imports a font. The font name is looked up in the RtfDocumentHeader and then the mapping from original font number to actual font number is added.

public bool ImportFont(string fontNr, string fontName, string fontFamily, int charset)

Parameters

fontNr string

The original font number.

fontName string

The font name to look up.

fontFamily string
charset int

The characterset to use for the font.

Returns

bool

ImportList(string, string)

Imports a List value. The List number for the List defined is determined and then the resulting mapping is added.

public void ImportList(string origListNr, string newListNr)

Parameters

origListNr string
newListNr string

ImportStylesheetList(string, List)

Imports a stylesheet list value. The stylesheet number for the stylesheet defined is determined and then the resulting mapping is added.

public bool ImportStylesheetList(string listNr, List listIn)

Parameters

listNr string
listIn List

Returns

bool

MapColorNr(string)

Performs the mapping from the original font number to the actual font number used in the RTF document. If the color number was not seen during import (thus no mapping) then 0 is returned, guaranteeing that the color number is always valid.

public string MapColorNr(string colorNr)

Parameters

colorNr string

The color number to map.

Returns

string

The mapped color number

MapFontNr(string)

Performs the mapping from the original font number to the actual font number in the resulting RTF document. If the font number was not seen during import (thus no mapping) then 0 is returned, guaranteeing that the font number is always valid.

public string MapFontNr(string fontNr)

Parameters

fontNr string

The font number to map.

Returns

string

The mapped font number.

MapListNr(string)

Performs the mapping from the original list number to the actual list number in the resulting RTF document. If the list number was not seen during import (thus no mapping) then 0 is returned, guaranteeing that the list number is always valid.

public string MapListNr(string listNr)

Parameters

listNr string

Returns

string

MapStylesheetListNr(string)

Performs the mapping from the original stylesheet number to the actual stylesheet number in the resulting RTF document. If the stylesheet number was not seen during import (thus no mapping) then 0 is returned, guaranteeing that the stylesheet number is always valid.

public string MapStylesheetListNr(string listNr)

Parameters

listNr string

Returns

string