Table of Contents

Class List

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

A List contains several ListItems.

public class List : ITextElementArray, IElement
Inheritance
List
Implements
Derived
Inherited Members

Examples

Example 1: List list = new List(true, 20); list.Add(new ListItem("First line")); list.Add(new ListItem("The second line is longer to see what happens once the end of the line is reached. Will it start on a new line?")); list.Add(new ListItem("Third line")); The result of this code looks like this: First line The second line is longer to see what happens once the end of the line is reached. Will it start on a new line? Third line Example 2: List overview = new List(false, 10); overview.Add(new ListItem("This is an item")); overview.Add("This is another item"); The result of this code looks like this: This is an item This is another item

Constructors

List()

constructors

public List()

List(bool)

Constructs a List .

public List(bool numbered)

Parameters

numbered bool

a bool

List(bool, bool)

Constructs a List .

public List(bool numbered, bool lettered)

Parameters

numbered bool

a bool

lettered bool

has the list to be 'numbered' with letters

List(bool, bool, float)

Constructs a List.

public List(bool numbered, bool lettered, float symbolIndent)

Parameters

numbered bool

a bool

lettered bool

a bool

symbolIndent float

the indentation that has to be used for the listsymbol

List(bool, float)

Constructs a List.

public List(bool numbered, float symbolIndent)

Parameters

numbered bool

a bool

symbolIndent float

the indentation that has to be used for the listsymbol

Remarks

the parameter symbolIndent is important for instance when generating PDF-documents; it indicates the indentation of the listsymbol.

List(float)

Constructs a List with a specific symbol indentation. @since iText 2.0.8

public List(float symbolIndent)

Parameters

symbolIndent float

the symbol indentation

Fields

ALPHABETICAL

a possible value for the lettered parameter

public const bool ALPHABETICAL = true

Field Value

bool

LOWERCASE

a possible value for the lettered parameter

public const bool LOWERCASE = true

Field Value

bool

NUMERICAL

a possible value for the lettered parameter

public const bool NUMERICAL = false

Field Value

bool

ORDERED

membervariables

public const bool ORDERED = true

Field Value

bool

UNORDERED

a possible value for the numbered parameter

public const bool UNORDERED = false

Field Value

bool

UPPERCASE

a possible value for the lettered parameter

public const bool UPPERCASE = false

Field Value

bool

alignindent

Indicates if the indentation of all the items has to be aligned.

protected bool alignindent

Field Value

bool

autoindent

Indicates if the indentation has to be set automatically.

protected bool autoindent

Field Value

bool

first

This variable indicates the first number of a numbered list.

protected int first

Field Value

int

indentationLeft

The indentation of this list on the left side.

protected float indentationLeft

Field Value

float

indentationRight

The indentation of this list on the right side.

protected float indentationRight

Field Value

float

lettered

Indicates if the listsymbols are numerical or alphabetical.

protected bool lettered

Field Value

bool

list

This is the ArrayList containing the different ListItems.

protected List<IElement> list

Field Value

List<IElement>

lowercase

Indicates if the listsymbols are lowercase or uppercase.

protected bool lowercase

Field Value

bool

numbered

Indicates if the list has to be numbered.

protected bool numbered

Field Value

bool

postSymbol

In case you are using numbered/lettered lists, this String is added after the number/letter. @since iText 2.1.1

protected string postSymbol

Field Value

string

preSymbol

In case you are using numbered/lettered lists, this String is added before the number/letter. @since iText 2.1.1

protected string preSymbol

Field Value

string

symbol

This is the listsymbol of a list that is not numbered.

protected Chunk symbol

Field Value

Chunk

symbolIndent

The indentation of the listitems.

protected float symbolIndent

Field Value

float

Properties

Alignindent

implementation of the Element-methods

public bool Alignindent { get; set; }

Property Value

bool

Autoindent

public bool Autoindent { get; set; }

Property Value

bool

Chunks

Gets all the chunks in this element.

public IList<Chunk> Chunks { get; }

Property Value

IList<Chunk>

an ArrayList

First

Get/set the first number

public int First { get; set; }

Property Value

int

an int

IndentationLeft

Get/set the indentation of this paragraph on the left side.

public float IndentationLeft { get; set; }

Property Value

float

the indentation

IndentationRight

Get/set the indentation of this paragraph on the right side.

public float IndentationRight { get; set; }

Property Value

float

the indentation

Items

Gets all the items in the list.

public IList<IElement> Items { get; }

Property Value

IList<IElement>

an ArrayList containing ListItems

Lettered

public bool Lettered { get; set; }

Property Value

bool

ListSymbol

Sets the symbol

public Chunk ListSymbol { set; }

Property Value

Chunk

a Chunk

Lowercase

public bool Lowercase { get; set; }

Property Value

bool

Numbered

public bool Numbered { get; set; }

Property Value

bool

PostSymbol

Sets the String that has to be added after a number or letter in the list symbol. @since iText 2.1.1

public string PostSymbol { get; set; }

Property Value

string

PreSymbol

Sets the String that has to be added before a number or letter in the list symbol. @since iText 2.1.1

public string PreSymbol { get; set; }

Property Value

string

Size

methods to retrieve information

public int Size { get; }

Property Value

int

a size

Symbol

Get/set the symbol indentation.

public Chunk Symbol { get; set; }

Property Value

Chunk

a Chunk

SymbolIndent

Gets the symbol indentation.

public float SymbolIndent { get; set; }

Property Value

float

the symbol indentation

TotalLeading

Gets the leading of the first listitem.

public float TotalLeading { get; }

Property Value

float

a leading

Type

Gets the type of the text element.

public int Type { get; }

Property Value

int

a type

Methods

Add(IElement)

Adds an Object to the List.

public virtual bool Add(IElement o)

Parameters

o IElement

the object to add

Returns

bool

true is successful

GetPostSymbol()

Returns the String that is after a number or letter in the list symbol. @since iText 2.1.1

public string GetPostSymbol()

Returns

string

String that is after a number or letter in the list symbol

IsContent()

@see com.lowagie.text.Element#isContent() @since iText 2.0.8

public bool IsContent()

Returns

bool

IsEmpty()

Returns true if the list is empty.

public virtual bool IsEmpty()

Returns

bool

true if the list is empty

IsNestable()

@see com.lowagie.text.Element#isNestable() @since iText 2.0.8

public bool IsNestable()

Returns

bool

NormalizeIndentation()

Makes sure all the items in the list have the same indentation.

public void NormalizeIndentation()

Process(IElementListener)

Processes the element by adding it (or the different parts) to an IElementListener.

public bool Process(IElementListener listener)

Parameters

listener IElementListener

an IElementListener

Returns

bool

true if the element was processed successfully

SetListSymbol(string)

Sets the listsymbol.

public void SetListSymbol(string symbol)

Parameters

symbol string

a string

Remarks

This is a shortcut for SetListSymbol(Chunk symbol).