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
boola bool
List(bool, bool)
Constructs a List .
public List(bool numbered, bool lettered)
Parameters
List(bool, bool, float)
Constructs a List.
public List(bool numbered, bool lettered, float symbolIndent)
Parameters
numbered
boola bool
lettered
boola bool
symbolIndent
floatthe indentation that has to be used for the listsymbol
List(bool, float)
Constructs a List.
public List(bool numbered, float symbolIndent)
Parameters
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
floatthe symbol indentation
Fields
ALPHABETICAL
a possible value for the lettered parameter
public const bool ALPHABETICAL = true
Field Value
LOWERCASE
a possible value for the lettered parameter
public const bool LOWERCASE = true
Field Value
NUMERICAL
a possible value for the lettered parameter
public const bool NUMERICAL = false
Field Value
ORDERED
membervariables
public const bool ORDERED = true
Field Value
UNORDERED
a possible value for the numbered parameter
public const bool UNORDERED = false
Field Value
UPPERCASE
a possible value for the lettered parameter
public const bool UPPERCASE = false
Field Value
alignindent
Indicates if the indentation of all the items has to be aligned.
protected bool alignindent
Field Value
autoindent
Indicates if the indentation has to be set automatically.
protected bool autoindent
Field Value
first
This variable indicates the first number of a numbered list.
protected int first
Field Value
indentationLeft
The indentation of this list on the left side.
protected float indentationLeft
Field Value
indentationRight
The indentation of this list on the right side.
protected float indentationRight
Field Value
lettered
Indicates if the listsymbols are numerical or alphabetical.
protected bool lettered
Field Value
list
This is the ArrayList containing the different ListItems.
protected List<IElement> list
Field Value
lowercase
Indicates if the listsymbols are lowercase or uppercase.
protected bool lowercase
Field Value
numbered
Indicates if the list has to be numbered.
protected bool numbered
Field Value
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
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
symbol
This is the listsymbol of a list that is not numbered.
protected Chunk symbol
Field Value
symbolIndent
The indentation of the listitems.
protected float symbolIndent
Field Value
Properties
Alignindent
implementation of the Element-methods
public bool Alignindent { get; set; }
Property Value
Autoindent
public bool Autoindent { get; set; }
Property Value
Chunks
Gets all the chunks in this element.
public IList<Chunk> Chunks { get; }
Property Value
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
Lettered
public bool Lettered { get; set; }
Property Value
ListSymbol
Sets the symbol
public Chunk ListSymbol { set; }
Property Value
- Chunk
a Chunk
Lowercase
public bool Lowercase { get; set; }
Property Value
Numbered
public bool Numbered { get; set; }
Property Value
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
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
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
IElementthe 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
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
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
IElementListeneran IElementListener
Returns
- bool
true if the element was processed successfully
SetListSymbol(string)
Sets the listsymbol.
public void SetListSymbol(string symbol)
Parameters
symbol
stringa string
Remarks
This is a shortcut for SetListSymbol(Chunk symbol).