Lists

A List is a page element that contains an Item collection arranged in a sequential order.

The List can be categorized into two types.

Custom bullets can also be created by using the UnorderedListStyle class. Under ListItems SubLists is an option. There are two types of SubLists.

Set the properties of the List either in the Main List level or subList level or ListItem Level. If the Listed Items in the List goes beyond the given height of the List it is called Overflow. Using the OrderedList/UnorderedList GetOverflow methods to flow the List onto other pages.

The following example shows how to create an OrderedList in a document.

OrderedList list = new OrderedList(50, 50, 300, 500);
list.ListItemTopMargin = 5;
list.ListItemBottomMargin = 5;
list.BulletPrefix = "(";
list.BulletSuffix = ")";
list.TextColor = RgbColor.BlueViolet;
ListItem item1 = list.Items.Add("List item 1");
item1.Underline = true;
ListItem item2 = list.Items.Add("List item 2");
item2.Underline = true;
ListItem item3 = list.Items.Add("List item 3");
item3.Underline = true;
ListItem item4 = list.Items.Add("List item 4");
item4.Underline = true;
OrderedSubList subList1 = item1.SubLists.AddOrderedSubList(NumberingStyle.RomanUpperCase);
subList1.TextColor = RgbColor.HotPink;
ListItem item5 = subList1.Items.Add("Sub-list item 1");
ListItem item6 = subList1.Items.Add("Sub-list item 2");
OrderedSubList subList2 = item5.SubLists.AddOrderedSubList(NumberingStyle.AlphabeticLowerCase);
subList2.TextColor = RgbColor.DarkGoldenRod;
ListItem item7 = subList2.Items.Add("Second level sub-list item 1");
ListItem item8 = subList2.Items.Add("Second level sub-list item 2");
OrderedSubList subList3 = item6.SubLists.AddOrderedSubList(NumberingStyle.AlphabeticLowerCase);
subList3.TextColor = RgbColor.DarkGoldenRod;
ListItem item9 = subList3.Items.Add("Second level sub-list item 1");
ListItem item10 = subList3.Items.Add("Second level sub-list item 2");
OrderedSubList subList4 = item2.SubLists.AddOrderedSubList(NumberingStyle.RomanUpperCase);
subList4.TextColor = RgbColor.HotPink;
ListItem item11 = subList4.Items.Add("Sub-list item 1");
ListItem item12 = subList4.Items.Add("Sub-list item 2");
OrderedSubList subList5 = item11.SubLists.AddOrderedSubList(NumberingStyle.AlphabeticLowerCase);
subList5.TextColor = RgbColor.DarkGoldenRod;
ListItem item13 = subList5.Items.Add("Second level sub-list item 1");
ListItem item14 = subList5.Items.Add("Second level sub-list item 2");
OrderedSubList subList6 = item12.SubLists.AddOrderedSubList(NumberingStyle.AlphabeticLowerCase);
subList6.TextColor = RgbColor.DarkGoldenRod;
ListItem item15 = subList6.Items.Add("Second level sub-list item 1");
ListItem item16 = subList6.Items.Add("Second level sub-list item 2");
OrderedSubList subList7 = item3.SubLists.AddOrderedSubList(NumberingStyle.RomanUpperCase);
subList7.TextColor = RgbColor.HotPink;
ListItem item17 = subList7.Items.Add("Sub-list item 1");
ListItem item18 = subList7.Items.Add("Sub-list item 2");
page.Elements.Add(list);        
Dim list As OrderedList = New OrderedList(50, 50, 300, 500)
list.ListItemTopMargin = 5
list.ListItemBottomMargin = 5
list.BulletPrefix = "("
list.BulletSuffix = ")"
list.TextColor = RgbColor.BlueViolet
Dim item1 As ListItem = list.Items.Add("List item 1")
item1.Underline = True
Dim item2 As ListItem = list.Items.Add("List item 2")
item2.Underline = True
Dim item3 As ListItem = list.Items.Add("List item 3")
item3.Underline = True
Dim item4 As ListItem = list.Items.Add("List item 4")
item4.Underline = True
Dim subList1 As OrderedSubList = item1.SubLists.AddOrderedSubList(NumberingStyle.RomanUpperCase)
subList1.TextColor = RgbColor.HotPink
Dim item5 As ListItem = subList1.Items.Add("Sub-list item 1")
Dim item6 As ListItem = subList1.Items.Add("Sub-list item 2")
Dim subList2 As OrderedSubList = item2.SubLists.AddOrderedSubList(NumberingStyle.AlphabeticLowerCase)
subList2.TextColor = RgbColor.DarkGoldenRod
Dim item7 As ListItem = subList2.Items.Add("Second level sub-list item 1")
Dim item8 As ListItem = subList2.Items.Add("Second level sub-list item 2")
Dim subList3 As OrderedSubList = item3.SubLists.AddOrderedSubList(NumberingStyle.AlphabeticLowerCase)
subList3.TextColor = RgbColor.DarkGoldenRod
Dim item9 As ListItem = subList3.Items.Add("Second level sub-list item 1")
Dim item10 As ListItem = subList3.Items.Add("Second level sub-list item 2")
Dim subList4 As OrderedSubList = item6.SubLists.AddOrderedSubList(NumberingStyle.RomanUpperCase)
subList4.TextColor = RgbColor.HotPink
Dim item11 As ListItem = subList4.Items.Add("Sub-list item 1")
Dim item12 As ListItem = subList4.Items.Add("Sub-list item 2")
Dim subList5 As OrderedSubList = item7.SubLists.AddOrderedSubList(NumberingStyle.AlphabeticLowerCase)
subList5.TextColor = RgbColor.DarkGoldenRod
Dim item13 As ListItem = subList5.Items.Add("Second level sub-list item 1")
Dim item14 As ListItem = subList5.Items.Add("Second level sub-list item 2")
Dim subList6 As OrderedSubList = item4.SubLists.AddOrderedSubList(NumberingStyle.AlphabeticLowerCase)
subList6.TextColor = RgbColor.DarkGoldenRod
Dim item15 As ListItem = subList6.Items.Add("Second level sub-list item 1")
Dim item16 As ListItem = subList6.Items.Add("Second level sub-list item 2")
Dim subList7 As OrderedSubList = item5.SubLists.AddOrderedSubList(NumberingStyle.RomanUpperCase)
subList7.TextColor = RgbColor.HotPink
Dim item17 As ListItem = subList7.Items.Add("Sub-list item 1")
Dim item18 As ListItem = subList7.Items.Add("Sub-list item 2")
MyPage.Elements.Add(list)

In this topic