cete.dynamicpdf.pageelements.unorderedlist
UnorderedList
- Namespace: ceTe.DynamicPDF.PageElements
- Assemblies: ceTe.DynamicPDF.40.dll
Represents the unordered list.
public class UnorderedList : List, IArea, ICoordinate, ISerializable
Public Class UnorderedList
Inherits List
Implements IArea, ICoordinate, ISerializable
Inheritance: Object → PageElement → TaggablePageElement → RotatingPageElement → List → UnorderedList
Implements: IArea, ICoordinate, ISerializable
Licensing
This class is a DynamicPDF Generator Professional Edition feature. One of the following licenses is required for non-evaluation usage:
- DynamicPDF Generator for .NET Professional Edition
- DynamicPDF Generator for .NET Enterprise Edition
- DynamicPDF Merger for .NET Professional Edition
- DynamicPDF Merger for .NET Enterprise Edition
- DynamicPDF ReportWriter for .NET Professional Edition
- DynamicPDF ReportWriter for .NET Enterprise Edition
- DynamicPDF Core Suite for .NET Professional Edition
- DynamicPDF Core Suite for .NET Enterprise Edition
Examples
The following example shows a UnorderedList text being displayed on the page.
Imports System
Imports ceTe.DynamicPDF
Imports ceTe.DynamicPDF.PageElements
Module MyModuleSub Main()
' Create a PDF Document Dim MyDocument As Document = New Document
' Create a Page and add it to the document Dim MyPage As Page = New Page MyDocument.Pages.Add(MyPage)
' Create an UnorderedList. Dim list As UnorderedList = New UnorderedList(50,120,300,500,Font.Helvetica,12,UnorderedListStyle.Disc)
list.ListItemTopMargin = 5 list.ListItemBottomMargin = 5 list.TextColor = RgbColor.HotPink Dim label1 As Label = New Label("CeTe Software specializes in components for dynamic PDF generation and manipulation. The DynamicPDF product line allows you to dynamically generate PDF documents, merge PDF documents and add new content to existing PDF documents from within your applications.",50,50,400,200) label1.Align = TextAlign.Justify
' Add ListItem to the List. Dim item1 As ListItem = list.Items.Add(".NET products") item1.Underline = true Dim item2 As ListItem = list.Items.Add("JAVA products") item2.Underline = true Dim item3 As ListItem = list.Items.Add("COM products") item3.Underline = true
' Add UnorderedSubList under ListItem item1. Dim subList1 As UnorderedSubList = item1.SubLists.AddUnorderedSubList(UnorderedListStyle.Square) subList1.TextColor = RgbColor.DarkGoldenRod Dim item4 As ListItem = subList1.Items.Add("DynamicPDF Generator for .NET") Dim item5 As ListItem = subList1.Items.Add("DynamicPDF Merger for .NET")
Dim subList2 As UnorderedSubList = item2.SubLists.AddUnorderedSubList(UnorderedListStyle.Square) subList2.TextColor = RgbColor.DarkGoldenRod Dim item6 As ListItem = subList2.Items.Add("DynamicPDF Generator for JAVA") Dim item7 As ListItem = subList2.Items.Add("DynamicPDF Merger for JAVA")
Dim subList3 As UnorderedSubList = item3.SubLists.AddUnorderedSubList(UnorderedListStyle.Asterisk) subList3.TextColor = RgbColor.DarkGoldenRod Dim item8 As ListItem = subList3.Items.Add("DynamicPDF Generator") Dim item9 As ListItem = subList3.Items.Add("DynamicPDF ReportWriter")
Dim subList4 As UnorderedSubList = item6.SubLists.AddUnorderedSubList(UnorderedListStyle.Asterisk) subList4.TextColor = RgbColor.BlueViolet Dim item10 As ListItem = subList4.Items.Add("Community Edition") Dim item11 As ListItem = subList4.Items.Add("Developer Edition") Dim item12 As ListItem = subList4.Items.Add("Server Edition")
Dim subList5 As UnorderedSubList = item7.SubLists.AddUnorderedSubList(UnorderedListStyle.Asterisk) subList5.TextColor = RgbColor.BlueViolet Dim item13 As ListItem = subList5.Items.Add("Evaluation Edition") Dim item14 As ListItem = subList5.Items.Add("Developer Edition") Dim item15 As ListItem = subList5.Items.Add("Server Edition")
Dim subList6 As UnorderedSubList = item4.SubLists.AddUnorderedSubList(UnorderedListStyle.Asterisk) subList6.TextColor = RgbColor.BlueViolet Dim item16 As ListItem = subList6.Items.Add("Community Edition") Dim item17 As ListItem = subList6.Items.Add("Professional Edition") Dim item18 As ListItem = subList6.Items.Add("Enterprise Edition")
Dim subList7 As UnorderedSubList = item5.SubLists.AddUnorderedSubList(UnorderedListStyle.Asterisk) subList7.TextColor = RgbColor.BlueViolet Dim item19 As ListItem = subList7.Items.Add("Standard Edition") Dim item20 As ListItem = subList7.Items.Add("Professional Edition") Dim item21 As ListItem = subList7.Items.Add("Enterprise Edition")
' Add UnorderedList to the page. MyPage.Elements.Add(list) MyPage.Elements.Add(label1)
' Save the PDF MyDocument.Draw("C:\MyDocument.pdf")End Sub
End Module
using System;
using ceTe.DynamicPDF;
using ceTe.DynamicPDF.PageElements;
class MyClass
{static void Main(){ // Create a PDF Document. Document doc = new Document();
// Create a Page. Page page1 = new Page();
// Create a UnorderedList. UnorderedList list = new UnorderedList(50,120,300,500,Font.Helvetica,12,UnorderedListStyle.Disc);
list.ListItemTopMargin = 5; list.ListItemBottomMargin = 5; list.TextColor = RgbColor.HotPink; Label label1 = new Label("CeTe Software specializes in components for dynamic PDF generation and manipulation. The DynamicPDF product line allows you to dynamically generate PDF documents, merge PDF documents and add new content to existing PDF documents from within your applications.",50,50,400,200); label1.Align = TextAlign.Justify;
// Add ListItem to the List. ListItem item1 = list.Items.Add(".NET products"); item1.Underline = true; ListItem item2 = list.Items.Add("JAVA products"); item2.Underline = true; ListItem item3 = list.Items.Add("COM products"); item3.Underline = true;
// Add UnorderedSubList under ListItem item1. UnorderedSubList subList1 = item1.SubLists.AddUnorderedSubList(UnorderedListStyle.Square); subList1.TextColor = RgbColor.DarkGoldenRod; ListItem item4 = subList1.Items.Add("DynamicPDF Generator for .NET"); ListItem item5 = subList1.Items.Add("DynamicPDF Merger for .NET");
UnorderedSubList subList2 = item2.SubLists.AddUnorderedSubList(UnorderedListStyle.Square); subList2.TextColor = RgbColor.DarkGoldenRod; ListItem item6 = subList2.Items.Add("DynamicPDF Generator for JAVA"); ListItem item7 = subList2.Items.Add("DynamicPDF Merger for JAVA");
UnorderedSubList subList3 = item3.SubLists.AddUnorderedSubList(UnorderedListStyle.Asterisk); subList3.TextColor = RgbColor.DarkGoldenRod; ListItem item8 = subList3.Items.Add("DynamicPDF Generator"); ListItem item9 = subList3.Items.Add("DynamicPDF ReportWriter");
UnorderedSubList subList4 = item6.SubLists.AddUnorderedSubList(UnorderedListStyle.Asterisk); subList4.TextColor = RgbColor.BlueViolet; ListItem item10 = subList4.Items.Add("Community Edition"); ListItem item11 = subList4.Items.Add("Developer Edition"); ListItem item12 = subList4.Items.Add("Server Edition");
UnorderedSubList subList5 = item7.SubLists.AddUnorderedSubList(UnorderedListStyle.Asterisk); subList5.TextColor = RgbColor.BlueViolet; ListItem item13 = subList5.Items.Add("Evaluation Edition"); ListItem item14 = subList5.Items.Add("Developer Edition"); ListItem item15 = subList5.Items.Add("Server Edition");
UnorderedSubList subList6 = item4.SubLists.AddUnorderedSubList(UnorderedListStyle.Asterisk); subList6.TextColor = RgbColor.BlueViolet; ListItem item16 = subList6.Items.Add("Community Edition"); ListItem item17 = subList6.Items.Add("Professional Edition"); ListItem item18 = subList6.Items.Add("Enterprise Edition");
UnorderedSubList subList7 = item5.SubLists.AddUnorderedSubList(UnorderedListStyle.Asterisk); subList7.TextColor = RgbColor.BlueViolet; ListItem item19 = subList7.Items.Add("Standard Edition"); ListItem item20 = subList7.Items.Add("Professional Edition"); ListItem item21 = subList7.Items.Add("Enterprise Edition");
// Add the UnorderedList to the page. page1.Elements.Add(list); page1.Elements.Add(label1);
// Add the Page to the Document. doc.Pages.Add(page1);
// Save the PDF. doc.Draw(@"c:\MyDocument.pdf");}
}
Remarks
See the Lists topic for more on unordered lists.
NOTE: This page element cannot be used within a table cell, or tranformation group.
Constructors
UnorderedList(Single, Single, Single, Single)
Creating new Instance of the UnorderedList.
public UnorderedList(float x, float y, float width, float height)
Public Sub New (x As Single, y As Single, width As Single, height As Single)
Parameters
- x: Single
X coordinate of the UnorderedList.
- y: Single
Y coordinate of the UnorderedList.
- width: Single
Width of the UnorderedList.
- height: Single
Height of the UnorderedList.
UnorderedList(Single, Single, Single, Single, Font, Single)
Creating new Instance of the UnorderedList.
public UnorderedList(float x, float y, float width, float height, Font font, float fontSize)
Public Sub New (x As Single, y As Single, width As Single, height As Single, font As Font, fontSize As Single)
Parameters
- x: Single
X coordinate of the UnorderedList.
- y: Single
Y coordinate of the UnorderedList.
- width: Single
Width of the UnorderedList.
- height: Single
Height of the UnorderedList.
- font: Font
Font of the UnorderedList.
- fontSize: Single
FontSize of the UnorderedList.
UnorderedList(Single, Single, Single, Single, Font, Single, UnorderedListStyle)
Creating new Instance of the UnorderedList.
public UnorderedList(float x, float y, float width, float height, Font font, float fontSize, UnorderedListStyle bullet)
Public Sub New (x As Single, y As Single, width As Single, height As Single, font As Font, fontSize As Single, bullet As UnorderedListStyle)
Parameters
- x: Single
X coordinate of the UnorderedList.
- y: Single
Y coordinate of the UnorderedList.
- width: Single
Width of the UnorderedList.
- height: Single
Height of the UnorderedList.
- font: Font
Font of the UnorderedList.
- fontSize: Single
FontSize of the UnorderedList.
- bullet: UnorderedListStyle
UnorderedListStyle of the UnorderedList.
Properties
Angle
Gets or sets the heights of the angle element. (Inherited from RotatingPageElement)
public float Angle { get; set; }
Public Property Angle As Single
Property Value
BulletAlign
Gets or sets the Align enumeration that specifies the Bullet alignment of the List. (Inherited from List)
public Align BulletAlign { get; set; }
Public Property BulletAlign As Align
Property Value
BulletAreaWidth
Gets or sets the Width in which bullets will be drawn, for each ListItem of the List. (Inherited from List)
public float BulletAreaWidth { get; set; }
Public Property BulletAreaWidth As Single
Property Value
BulletSize
Gets or Sets the bullet's size for the List . (Inherited from List)
public float BulletSize { get; set; }
Public Property BulletSize As Single
Property Value
BulletStyle
Gets or Sets the BulletStyle of the List.
public UnorderedListStyle BulletStyle { get; set; }
Public Property BulletStyle As UnorderedListStyle
Property Value
Font
Gets or sets the Font of the text for the List. (Inherited from List)
public Font Font { get; set; }
Public Property Font As Font
Property Value
FontSize
Gets or Sets the Fontsize of the List. (Inherited from List)
public float FontSize { get; set; }
Public Property FontSize As Single
Property Value
Height
Gets or sets the Height of the List. (Inherited from List)
public float Height { get; set; }
Public Property Height As Single
Property Value
ID
Gets or sets the ID of the page element. (Inherited from PageElement)
public string ID { get; set; }
Public Property ID As String
Property Value
Items
Gets the ListItemLists of the List. (Inherited from List)
public ListItemList Items { get; }
Public Property Items As ListItemList
Property Value
Leading
Gets or Sets the leading for the text of the List. (Inherited from List)
public float Leading { get; set; }
Public Property Leading As Single
Property Value
LeftIndent
Gets or Sets the LeftIndent of the whole List. Each ListItem may have his own LeftIndent. (Inherited from List)
public float LeftIndent { get; set; }
Public Property LeftIndent As Single
Property Value
ListItemBottomMargin
Gets or Sets the BottomMargin of the ListItems in the List. (Inherited from List)
public float ListItemBottomMargin { get; set; }
Public Property ListItemBottomMargin As Single
Property Value
ListItemTopMargin
Gets or Sets the TopMargin of the ListItems in the List. (Inherited from List)
public float ListItemTopMargin { get; set; }
Public Property ListItemTopMargin As Single
Property Value
ParagraphIndent
Gets or Sets the paragraphIndent of the List. (Inherited from List)
public float ParagraphIndent { get; set; }
Public Property ParagraphIndent As Single
Property Value
RightIndent
Gets or Sets the RightIndent of the whole List. Each ListItem may have his own RightIndent. (Inherited from List)
public float RightIndent { get; set; }
Public Property RightIndent As Single
Property Value
RightToLeft
Gets or Sets a value indicating if the Text is in RighttoLeft language. (Inherited from List)
public bool RightToLeft { get; set; }
Public Property RightToLeft As Boolean
Property Value
StrikeThrough
Gets or Sets the text of each ListItem of the List as StrikeThrough. (Inherited from List)
public bool StrikeThrough { get; set; }
Public Property StrikeThrough As Boolean
Property Value
Tag
Gets or sets the tag of the taggable element. (Inherited from List)
public Tag Tag { get; set; }
Public Property Tag As Tag
Property Value
Licensing
This property is a DynamicPDF Generator Enterprise Edition feature. One of the following licenses is required for non-evaluation usage:
- DynamicPDF Generator for .NET Enterprise Edition
- DynamicPDF Merger for .NET Enterprise Edition
- DynamicPDF ReportWriter for .NET Enterprise Edition
- DynamicPDF Core Suite for .NET Enterprise Edition
TagOrder
Gets or sets the tag order of the taggable element. (Inherited from List)
public int TagOrder { get; set; }
Public Property TagOrder As Int32
Property Value
TextAlign
Gets or sets the TextAlign enumeration that specifies the text alignment of the List. (Inherited from List)
public TextAlign TextAlign { get; set; }
Public Property TextAlign As TextAlign
Property Value
TextColor
Gets or sets the Color of the Text for whole List. (Inherited from List)
public Color TextColor { get; set; }
Public Property TextColor As Color
Property Value
Width
Gets or sets the Width of the List. (Inherited from List)
public float Width { get; set; }
Public Property Width As Single
Property Value
X
Gets or sets the X coordinate of the page element. (Inherited from RotatingPageElement)
public float X { get; set; }
Public Property X As Single
Property Value
Y
Gets or sets the Y coordinate of the page element. (Inherited from RotatingPageElement)
public float Y { get; set; }
Public Property Y As Single
Property Value
Methods
Draw(PageWriter)
Draws the page element to the given PageWriter object. (Inherited from RotatingPageElement)
public void Draw(PageWriter writer)
Sub Draw(writer As PageWriter)
Parameters
- writer: PageWriter
PageWriter object to receive the page element's output.
Equals(Object)
Determines whether the specified Object is equal to the current Object . (Inherited from Object)
public bool Equals(Object obj)
Function Equals(obj As Object) As Boolean
Parameters
- obj: Object
The Object to compare with the current Object .
Returns
true if the specified Object is equal to the current Object ; otherwise, false.
GetHashCode()
Serves as a hash function for a particular type. (Inherited from Object)
public int GetHashCode()
Function GetHashCode() As Integer
Returns
A hash code for the current Object .
GetOverFlowList()
Gets a UnorderedList object containing the List Text.
public UnorderedList GetOverFlowList()
Function GetOverFlowList() As UnorderedList
Returns
Returns a UnorderedList object.
Examples
The following example shows you how to use the GetOverflowList object to allow text of variable length to flow onto new pages as needed.
Imports System
Imports ceTe.DynamicPDF
Imports ceTe.DynamicPDF.PageElements
Module MyModuleSub Main()
' Create a PDF Document Dim MyDocument As Document = New Document
' Create a Page and add it to the document Dim MyPage As Page = New Page MyDocument.Pages.Add(MyPage)
' Create the UnOrderedList. Dim list As UnorderedList = New UnorderedList(50,120,300,500,Font.Helvetica,12,UnorderedListStyle.Disc)
list.ListItemTopMargin = 5 list.ListItemBottomMargin = 5 list.TextColor = RgbColor.HotPink Dim label1 As Label = New Label("CeTe Software specializes in components for dynamic PDF generation and manipulation. The DynamicPDF product line allows you to dynamically generate PDF documents, merge PDF documents and add new content to existing PDF documents from within your applications.",50,50,400,200) label1.Align = TextAlign.Justify
' Add ListItem to the List. Dim item1 As ListItem = list.Items.Add(".NET products") item1.Underline = true Dim item2 As ListItem = list.Items.Add("JAVA products") item2.Underline = true Dim item3 As ListItem = list.Items.Add("COM products") item3.Underline = true
' Add UnorderedSubList under ListItem item1. Dim subList1 As UnorderedSubList = item1.SubLists.AddUnorderedSubList(UnorderedListStyle.Square) subList1.TextColor = RgbColor.DarkGoldenRod Dim item4 As ListItem = subList1.Items.Add("DynamicPDF Generator for .NET") Dim item5 As ListItem = subList1.Items.Add("DynamicPDF Merger for .NET")
Dim subList2 As UnorderedSubList = item2.SubLists.AddUnorderedSubList(UnorderedListStyle.Square) subList2.TextColor = RgbColor.DarkGoldenRod Dim item6 As ListItem = subList2.Items.Add("DynamicPDF Generator for JAVA") Dim item7 As ListItem = subList2.Items.Add("DynamicPDF Merger for JAVA")
Dim subList3 As UnorderedSubList = item3.SubLists.AddUnorderedSubList(UnorderedListStyle.Asterisk) subList3.TextColor = RgbColor.DarkGoldenRod Dim item8 As ListItem = subList3.Items.Add("DynamicPDF Generator") Dim item9 As ListItem = subList3.Items.Add("DynamicPDF ReportWriter")
Dim subList4 As UnorderedSubList = item6.SubLists.AddUnorderedSubList(UnorderedListStyle.Asterisk) subList4.TextColor = RgbColor.BlueViolet Dim item10 As ListItem = subList4.Items.Add("Community Edition") Dim item11 As ListItem = subList4.Items.Add("Developer Edition") Dim item12 As ListItem = subList4.Items.Add("Server Edition")
Dim subList5 As UnorderedSubList = item7.SubLists.AddUnorderedSubList(UnorderedListStyle.Asterisk) subList5.TextColor = RgbColor.BlueViolet Dim item13 As ListItem = subList5.Items.Add("Evaluation Edition") Dim item14 As ListItem = subList5.Items.Add("Developer Edition") Dim item15 As ListItem = subList5.Items.Add("Server Edition")
Dim subList6 As UnorderedSubList = item4.SubLists.AddUnorderedSubList(UnorderedListStyle.Asterisk) subList6.TextColor = RgbColor.BlueViolet Dim item16 As ListItem = subList6.Items.Add("Community Edition") Dim item17 As ListItem = subList6.Items.Add("Professional Edition") Dim item18 As ListItem = subList6.Items.Add("Enterprise Edition")
Dim subList7 As UnorderedSubList = item5.SubLists.AddUnorderedSubList(UnorderedListStyle.Asterisk) subList7.TextColor = RgbColor.BlueViolet Dim item19 As ListItem = subList7.Items.Add("Standard Edition") Dim item20 As ListItem = subList7.Items.Add("Professional Edition") Dim item21 As ListItem = subList7.Items.Add("Enterprise Edition")
' Add the UnorderedList to the Page. MyPage.Elements.Add(list) MyPage.Elements.Add(label1)
' Set the UnorderedList object equal to the rest of the text that did not fit ' if all the text did fit, GetOverflowList will return null list = list.GetOverFlowList()
while Not list is Nothing MyPage= new Page(PageSize.A4) MyPage.Elements.Add(list) MyDocument.Pages.Add(MyPage) list = list.GetOverFlowList() End While
' Save the PDF. MyDocument.Draw("C:\MyDocument.pdf")End sub
End Module
using System;
using ceTe.DynamicPDF;
using ceTe.DynamicPDF.PageElements;
class MyClass
{static void Main(){ // Create a PDF Document. Document doc = new Document();
// Create a Page. Page page1 = new Page();
// Create an UnorderedList. UnorderedList list = new UnorderedList(50,120,300,500,Font.Helvetica,12,UnorderedListStyle.Disc);
list.ListItemTopMargin = 5; list.ListItemBottomMargin = 5; list.TextColor = RgbColor.HotPink; Label label1 = new Label("CeTe Software specializes in components for dynamic PDF generation and manipulation. The DynamicPDF product line allows you to dynamically generate PDF documents, merge PDF documents and add new content to existing PDF documents from within your applications.",50,50,400,200); label1.Align = TextAlign.Justify;
// Add ListItem to the List. ListItem item1 = list.Items.Add(".NET products"); item1.Underline = true; ListItem item2 = list.Items.Add("JAVA products"); item2.Underline = true; ListItem item3 = list.Items.Add("COM products"); item3.Underline = true;
// Add UnorderedSubList under ListItem item1. UnorderedSubList subList1 = item1.SubLists.AddUnorderedSubList(UnorderedListStyle.Square); subList1.TextColor = RgbColor.DarkGoldenRod; ListItem item4 = subList1.Items.Add("DynamicPDF Generator for .NET"); ListItem item5 = subList1.Items.Add("DynamicPDF Merger for .NET");
UnorderedSubList subList2 = item2.SubLists.AddUnorderedSubList(UnorderedListStyle.Square); subList2.TextColor = RgbColor.DarkGoldenRod; ListItem item6 = subList2.Items.Add("DynamicPDF Generator for JAVA"); ListItem item7 = subList2.Items.Add("DynamicPDF Merger for JAVA");
UnorderedSubList subList3 = item3.SubLists.AddUnorderedSubList(UnorderedListStyle.Asterisk); subList3.TextColor = RgbColor.DarkGoldenRod; ListItem item8 = subList3.Items.Add("DynamicPDF Generator"); ListItem item9 = subList3.Items.Add("DynamicPDF ReportWriter");
UnorderedSubList subList4 = item6.SubLists.AddUnorderedSubList(UnorderedListStyle.Asterisk); subList4.TextColor = RgbColor.BlueViolet; ListItem item10 = subList4.Items.Add("Community Edition"); ListItem item11 = subList4.Items.Add("Developer Edition"); ListItem item12 = subList4.Items.Add("Server Edition");
UnorderedSubList subList5 = item7.SubLists.AddUnorderedSubList(UnorderedListStyle.Asterisk); subList5.TextColor = RgbColor.BlueViolet; ListItem item13 = subList5.Items.Add("Evaluation Edition"); ListItem item14 = subList5.Items.Add("Developer Edition"); ListItem item15 = subList5.Items.Add("Server Edition");
UnorderedSubList subList6 = item4.SubLists.AddUnorderedSubList(UnorderedListStyle.Asterisk); subList6.TextColor = RgbColor.BlueViolet; ListItem item16 = subList6.Items.Add("Community Edition"); ListItem item17 = subList6.Items.Add("Professional Edition"); ListItem item18 = subList6.Items.Add("Enterprise Edition");
UnorderedSubList subList7 = item5.SubLists.AddUnorderedSubList(UnorderedListStyle.Asterisk); subList7.TextColor = RgbColor.BlueViolet; ListItem item19 = subList7.Items.Add("Standard Edition"); ListItem item20 = subList7.Items.Add("Professional Edition"); ListItem item21 = subList7.Items.Add("Enterprise Edition");
// Add List to the page. page1.Elements.Add(list); page1.Elements.Add(label1);
// Add Page to the Document. doc.Pages.Add(page1);
// Set the UnorderedList object equal to the rest of the text that did not fit // if all the text did fit, GetOverflowList will return null list = list.GetOverFlowList();
while(list!=null){ page1= new Page(PageSize.A4); page1.Elements.Add(list); doc.Pages.Add(page1); list = list.GetOverFlowList(); }
// Save the PDF. doc.Draw(@"C:\MyDocument.pdf");}
}
Remarks
This method returns a new UnorderedList object that contains the remaining text that did not fit.
GetOverFlowList(Single, Single)
Gets a UnorderedList object containing the List Text.
public UnorderedList GetOverFlowList(float x, float y)
Function GetOverFlowList(x As Single, y As Single) As UnorderedList
Parameters
- x: Single
New X coordinate of the UnorderedList.
- y: Single
New Y coordinate of the UnorderedList.
Returns
Returns a UnorderedList object.
Examples
The following example shows you how to use the GetOverflowList object to allow text of variable length to flow onto new pages as needed.
Imports System
Imports ceTe.DynamicPDF
Imports ceTe.DynamicPDF.PageElements
Module MyModuleSub Main() ' Create a PDF Document Dim MyDocument As Document = New Document
' Create a Page and add it to the document Dim MyPage As Page = New Page MyDocument.Pages.Add(MyPage)
' Create an UnorderedList. Dim list As UnorderedList = New UnorderedList(50,120,300,500,Font.Helvetica,12,UnorderedListStyle.Disc)
list.ListItemTopMargin = 5 list.ListItemBottomMargin = 5 list.TextColor = RgbColor.HotPink Dim label1 As Label = New Label("CeTe Software specializes in components for dynamic PDF generation and manipulation. The DynamicPDF product line allows you to dynamically generate PDF documents, merge PDF documents and add new content to existing PDF documents from within your applications.",50,50,400,200) label1.Align = TextAlign.Justify
' Add ListItem to the List. Dim item1 As ListItem = list.Items.Add(".NET products") item1.Underline = true Dim item2 As ListItem = list.Items.Add("JAVA products") item2.Underline = true Dim item3 As ListItem = list.Items.Add("COM products") item3.Underline = true
' Add UnorderedSubList under ListItem item1. Dim subList1 As UnorderedSubList = item1.SubLists.AddUnorderedSubList(UnorderedListStyle.Square) subList1.TextColor = RgbColor.DarkGoldenRod Dim item4 As ListItem = subList1.Items.Add("DynamicPDF Generator for .NET") Dim item5 As ListItem = subList1.Items.Add("DynamicPDF Merger for .NET")
Dim subList2 As UnorderedSubList = item2.SubLists.AddUnorderedSubList(UnorderedListStyle.Square) subList2.TextColor = RgbColor.DarkGoldenRod Dim item6 As ListItem = subList2.Items.Add("DynamicPDF Generator for JAVA") Dim item7 As ListItem = subList2.Items.Add("DynamicPDF Merger for JAVA")
Dim subList3 As UnorderedSubList = item3.SubLists.AddUnorderedSubList(UnorderedListStyle.Asterisk) subList3.TextColor = RgbColor.DarkGoldenRod Dim item8 As ListItem = subList3.Items.Add("DynamicPDF Generator") Dim item9 As ListItem = subList3.Items.Add("DynamicPDF ReportWriter")
Dim subList4 As UnorderedSubList = item6.SubLists.AddUnorderedSubList(UnorderedListStyle.Asterisk) subList4.TextColor = RgbColor.BlueViolet Dim item10 As ListItem = subList4.Items.Add("Community Edition") Dim item11 As ListItem = subList4.Items.Add("Developer Edition") Dim item12 As ListItem = subList4.Items.Add("Server Edition")
Dim subList5 As UnorderedSubList = item7.SubLists.AddUnorderedSubList(UnorderedListStyle.Asterisk) subList5.TextColor = RgbColor.BlueViolet Dim item13 As ListItem = subList5.Items.Add("Evaluation Edition") Dim item14 As ListItem = subList5.Items.Add("Developer Edition") Dim item15 As ListItem = subList5.Items.Add("Server Edition")
Dim subList6 As UnorderedSubList = item4.SubLists.AddUnorderedSubList(UnorderedListStyle.Asterisk) subList6.TextColor = RgbColor.BlueViolet Dim item16 As ListItem = subList6.Items.Add("Community Edition") Dim item17 As ListItem = subList6.Items.Add("Professional Edition") Dim item18 As ListItem = subList6.Items.Add("Enterprise Edition")
Dim subList7 As UnorderedSubList = item5.SubLists.AddUnorderedSubList(UnorderedListStyle.Asterisk) subList7.TextColor = RgbColor.BlueViolet Dim item19 As ListItem = subList7.Items.Add("Standard Edition") Dim item20 As ListItem = subList7.Items.Add("Professional Edition") Dim item21 As ListItem = subList7.Items.Add("Enterprise Edition")
' Add UnOrderedList to the page. MyPage.Elements.Add(list) MyPage.Elements.Add(label1)
' Set the UnorderedList object equal to the rest of the text that did not fit ' if all the text did fit, GetOverflowList will return null list = list.GetOverFlowList(50,50)
while Not list is Nothing MyPage= new Page(PageSize.A4) MyPage.Elements.Add(list) MyDocument.Pages.Add(MyPage) list = list.GetOverFlowList(50,50) End While
' Save the PDF. MyDocument.Draw("C:\MyDocument.pdf")End sub
End Module
using System;
using ceTe.DynamicPDF;
using ceTe.DynamicPDF.PageElements;
class MyClass
{static void Main(){ // Create a PDF Document. Document doc = new Document();
// Create a Page. Page page1 = new Page();
// Create a UnorderedList. UnorderedList list = new UnorderedList(50,120,300,500,Font.Helvetica,12,UnorderedListStyle.Disc);
list.ListItemTopMargin = 5; list.ListItemBottomMargin = 5; list.TextColor = RgbColor.HotPink; Label label1 = new Label("CeTe Software specializes in components for dynamic PDF generation and manipulation. The DynamicPDF product line allows you to dynamically generate PDF documents, merge PDF documents and add new content to existing PDF documents from within your applications.",50,50,400,200); label1.Align = TextAlign.Justify;
// Add ListItem to the List. ListItem item1 = list.Items.Add(".NET products"); item1.Underline = true; ListItem item2 = list.Items.Add("JAVA products"); item2.Underline = true; ListItem item3 = list.Items.Add("COM products"); item3.Underline = true;
// Add UnorderedSubList under ListItem item1. UnorderedSubList subList1 = item1.SubLists.AddUnorderedSubList(UnorderedListStyle.Square); subList1.TextColor = RgbColor.DarkGoldenRod; ListItem item4 = subList1.Items.Add("DynamicPDF Generator for .NET"); ListItem item5 = subList1.Items.Add("DynamicPDF Merger for .NET");
UnorderedSubList subList2 = item2.SubLists.AddUnorderedSubList(UnorderedListStyle.Square); subList2.TextColor = RgbColor.DarkGoldenRod; ListItem item6 = subList2.Items.Add("DynamicPDF Generator for JAVA"); ListItem item7 = subList2.Items.Add("DynamicPDF Merger for JAVA");
UnorderedSubList subList3 = item3.SubLists.AddUnorderedSubList(UnorderedListStyle.Asterisk); subList3.TextColor = RgbColor.DarkGoldenRod; ListItem item8 = subList3.Items.Add("DynamicPDF Generator"); ListItem item9 = subList3.Items.Add("DynamicPDF ReportWriter");
UnorderedSubList subList4 = item6.SubLists.AddUnorderedSubList(UnorderedListStyle.Asterisk); subList4.TextColor = RgbColor.BlueViolet; ListItem item10 = subList4.Items.Add("Community Edition"); ListItem item11 = subList4.Items.Add("Developer Edition"); ListItem item12 = subList4.Items.Add("Server Edition");
UnorderedSubList subList5 = item7.SubLists.AddUnorderedSubList(UnorderedListStyle.Asterisk); subList5.TextColor = RgbColor.BlueViolet; ListItem item13 = subList5.Items.Add("Evaluation Edition"); ListItem item14 = subList5.Items.Add("Developer Edition"); ListItem item15 = subList5.Items.Add("Server Edition");
UnorderedSubList subList6 = item4.SubLists.AddUnorderedSubList(UnorderedListStyle.Asterisk); subList6.TextColor = RgbColor.BlueViolet; ListItem item16 = subList6.Items.Add("Community Edition"); ListItem item17 = subList6.Items.Add("Professional Edition"); ListItem item18 = subList6.Items.Add("Enterprise Edition");
UnorderedSubList subList7 = item5.SubLists.AddUnorderedSubList(UnorderedListStyle.Asterisk); subList7.TextColor = RgbColor.BlueViolet; ListItem item19 = subList7.Items.Add("Standard Edition"); ListItem item20 = subList7.Items.Add("Professional Edition"); ListItem item21 = subList7.Items.Add("Enterprise Edition");
// Add UnOrderedList to the page. page1.Elements.Add(list); page1.Elements.Add(label1);
// Add Page to the Document. doc.Pages.Add(page1);
// Set the UnorderedList object equal to the rest of the text that did not fit // if all the text did fit, GetOverflowList will return null list = list.GetOverFlowList(50,50);
while(list!=null){ page1= new Page(PageSize.A4); page1.Elements.Add(list); doc.Pages.Add(page1); list = list.GetOverFlowList(50,50); } // Save the PDF. doc.Draw(@"C:\MyDocument.pdf");}
}
Remarks
This method returns a new UnorderedList object that contains the remaining text that did not fit.
GetRequiredHeight()
Gets the height required to fit all of the text supplied.
public float GetRequiredHeight()
Function GetRequiredHeight() As Single
Returns
The float value indicating required height to display all text.
GetType()
Gets the Type of the current instance. (Inherited from Object)
public Type GetType()
Function GetType() As Type
Returns
The Type instance that represents the exact runtime type of the current instance.
ToString()
Returns a String that represents the current Object . (Inherited from Object)
public string ToString()
Function ToString() As String
Returns
A String that represents the current Object .