Class PdfListItem
Represents the list item of the list.
Inheritance
System.Object
PdfListItem
Inherited Members
System.Object.ToString()
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
Namespace: Syncfusion.Pdf.Lists
Assembly: Syncfusion.Pdf.Base.dll
Syntax
public class PdfListItem
Examples
//Create a new PDf document
PdfDocument document = new PdfDocument();
//Creates a new page and adds it as the last page of the document
PdfPage page = document.Pages.Add();
PdfGraphics graphics = page.Graphics;
string[] products = { "Tools", "Grid", "Chart", "Edit", "Diagram", "XlsIO", "Grouping", "Calculate", "PDF", "HTMLUI", "DocIO" };
// Creates an item collection
PdfListItemCollection listItemCollection = new PdfListItemCollection(products);
// Creates an item
PdfListItem item = new PdfListItem("Tools");
item.Font = new PdfStandardFont(PdfFontFamily.TimesRoman, 12);
// Creates Grid list item
PdfListItem gridItem = new PdfListItem("Grid");
gridItem.Font = new PdfStandardFont(PdfFontFamily.TimesRoman, 12);
// Adding items in collection
listItemCollection.Add(item);
listItemCollection.Add(gridItem);
//Create a unordered list
PdfUnorderedList list = new PdfUnorderedList(listItemCollection);
//Set the marker style
list.Marker.Style = PdfUnorderedMarkerStyle.Disk;
list.Draw(page, new RectangleF(0, 130, page.Graphics.ClientSize.Width, page.Graphics.ClientSize.Height));
document.Save("List.pdf");
'Create a new PDf document
Dim document As PdfDocument = New PdfDocument()
'Create a page
Dim page As PdfPage = document.Pages.Add()
Dim graphics As PdfGraphics = page.Graphics
Dim products() As String = { "Tools", "Grid", "Chart", "Edit", "Diagram", "XlsIO", "Grouping", "Calculate", "PDF", "HTMLUI", "DocIO" }
' Creates an item collection
Dim listItemCollection As PdfListItemCollection = New PdfListItemCollection(products)
' Creates an item
Dim item As PdfListItem = New PdfListItem("Tools")
item.Font = New PdfStandardFont(PdfFontFamily.TimesRoman, 12)
' Creates Grid list item
Dim gridItem As PdfListItem = New PdfListItem("Grid")
gridItem.Font = New PdfStandardFont(PdfFontFamily.TimesRoman, 12)
' Adding items in collection
listItemCollection.Add(item)
listItemCollection.Add(gridItem)
'Create a unordered list
Dim list As PdfUnorderedList = New PdfUnorderedList(listItemCollection)
'Set the marker style
list.Marker.Style = PdfUnorderedMarkerStyle.Disk
list.Draw(page, New RectangleF(0, 130, page.Graphics.ClientSize.Width, page.Graphics.ClientSize.Height))
document.Save("List.pdf")
Constructors
PdfListItem()
Creates new empty pdf list item.
Declaration
public PdfListItem()
Examples
//Create a new instance of PdfDocument class.
PdfDocument document = new PdfDocument();
//Add a new page to the document.
PdfPage page = document.Pages.Add();
//Get the PDF page graphics.
PdfGraphics graphics = page.Graphics;
SizeF size = page.Graphics.ClientSize;
//Create font
PdfFont font = new PdfStandardFont(PdfFontFamily.TimesRoman, 10, PdfFontStyle.Italic);
//Create string format
PdfStringFormat format = new PdfStringFormat();
format.LineSpacing = 10f;
//Create a new list.
PdfOrderedList list = new PdfOrderedList();
//Create new PDF list items.
PdfListItem item1 = new PdfListItem();
item1.Text = "PDF";
PdfListItem item2 = new PdfListItem();
item2.Text = "XlsIO";
list.Items.Add(item1);
list.Items.Add(item2);
//Draw the PDF list to page.
list.Draw(page, new RectangleF(0, 20, size.Width, size.Height));
// Save and close the document.
document.Save("Output.pdf");
document.Close(true);
'Create a new instance of PdfDocument class.
Dim document As New PdfDocument()
'Add a new page to the document.
Dim page As PdfPage = document.Pages.Add()
'Get the PDF page graphics.
Dim graphics As PdfGraphics = page.Graphics
Dim size As SizeF = page.Graphics.ClientSize
'Create font
Dim font As PdfFont = New PdfStandardFont(PdfFontFamily.TimesRoman, 10, PdfFontStyle.Italic)
'Create string format
Dim format As New PdfStringFormat()
format.LineSpacing = 10F
'Create a new list.
Dim list As New PdfOrderedList()
'Create new PDF list items.
Dim item1 As New PdfListItem()
item1.Text = "PDF"
Dim item2 As New PdfListItem()
item2.Text = "XlsIO"
list.Items.Add(item1)
list.Items.Add(item2)
'Draw the PDF list to page.
list.Draw(page, New RectangleF(0, 20, size.Width, size.Height))
' Save and close the document.
document.Save("Output.pdf")
document.Close(True)
PdfListItem(String)
Creates new pdf list item with default settings.
Declaration
public PdfListItem(string text)
Parameters
Type | Name | Description |
---|---|---|
System.String | text |
Examples
//Create a new instance of PdfDocument class.
PdfDocument document = new PdfDocument();
//Add a new page to the document.
PdfPage page = document.Pages.Add();
//Get the PDF page graphics.
PdfGraphics graphics = page.Graphics;
SizeF size = page.Graphics.ClientSize;
//Create font
PdfFont font = new PdfStandardFont(PdfFontFamily.TimesRoman, 10, PdfFontStyle.Italic);
//Create string format
PdfStringFormat format = new PdfStringFormat();
format.LineSpacing = 10f;
//Create a new list.
PdfOrderedList list = new PdfOrderedList();
//Create new PDF list items.
PdfListItem item1 = new PdfListItem("PDF");
PdfListItem item2 = new PdfListItem("XlsIO");
list.Items.Add(item1);
list.Items.Add(item2);
//Draw the PDF list to page.
list.Draw(page, new RectangleF(0, 20, size.Width, size.Height));
// Save and close the document.
document.Save("Output.pdf");
document.Close(true);
'Create a new instance of PdfDocument class.
Dim document As New PdfDocument()
'Add a new page to the document.
Dim page As PdfPage = document.Pages.Add()
'Get the PDF page graphics.
Dim graphics As PdfGraphics = page.Graphics
Dim size As SizeF = page.Graphics.ClientSize
'Create font
Dim font As PdfFont = New PdfStandardFont(PdfFontFamily.TimesRoman, 10, PdfFontStyle.Italic)
'Create string format
Dim format As New PdfStringFormat()
format.LineSpacing = 10F
'Create a new list.
Dim list As New PdfOrderedList()
'Create new PDF list items.
Dim item1 As New PdfListItem("PDF")
Dim item2 As New PdfListItem("XlsIO")
list.Items.Add(item1)
list.Items.Add(item2)
'Draw the PDF list to page.
list.Draw(page, New RectangleF(0, 20, size.Width, size.Height))
' Save and close the document.
document.Save("Output.pdf")
document.Close(True)
PdfListItem(String, PdfFont)
Initializes a new instance of the PdfListItem class.
Declaration
public PdfListItem(string text, PdfFont font)
Parameters
Type | Name | Description |
---|---|---|
System.String | text | The text of item. |
PdfFont | font | The font of item. |
Examples
//Create a new instance of PdfDocument class.
PdfDocument document = new PdfDocument();
//Add a new page to the document.
PdfPage page = document.Pages.Add();
//Get the PDF page graphics.
PdfGraphics graphics = page.Graphics;
SizeF size = page.Graphics.ClientSize;
//Create font
PdfFont font = new PdfStandardFont(PdfFontFamily.TimesRoman, 10, PdfFontStyle.Italic);
//Create string format
PdfStringFormat format = new PdfStringFormat();
format.LineSpacing = 10f;
//Create a new list.
PdfOrderedList list = new PdfOrderedList();
//Create new PDF list items.
PdfListItem item1 = new PdfListItem("PDF", font);
PdfListItem item2 = new PdfListItem("XlsIO", font);
list.Items.Add(item1);
list.Items.Add(item2);
//Draw the PDF list to page.
list.Draw(page, new RectangleF(0, 20, size.Width, size.Height));
// Save and close the document.
document.Save("Output.pdf");
document.Close(true);
'Create a new instance of PdfDocument class.
Dim document As New PdfDocument()
'Add a new page to the document.
Dim page As PdfPage = document.Pages.Add()
'Get the PDF page graphics.
Dim graphics As PdfGraphics = page.Graphics
Dim size As SizeF = page.Graphics.ClientSize
'Create font
Dim font As PdfFont = New PdfStandardFont(PdfFontFamily.TimesRoman, 10, PdfFontStyle.Italic)
'Create string format
Dim format As New PdfStringFormat()
format.LineSpacing = 10F
'Create a new list.
Dim list As New PdfOrderedList()
'Create new PDF list items.
Dim item1 As New PdfListItem("PDF", font)
Dim item2 As New PdfListItem("XlsIO", font)
list.Items.Add(item1)
list.Items.Add(item2)
'Draw the PDF list to page.
list.Draw(page, New RectangleF(0, 20, size.Width, size.Height))
' Save and close the document.
document.Save("Output.pdf")
document.Close(True)
PdfListItem(String, PdfFont, PdfStringFormat)
Initializes a new instance of the PdfListItem class.
Declaration
public PdfListItem(string text, PdfFont font, PdfStringFormat format)
Parameters
Type | Name | Description |
---|---|---|
System.String | text | The text of item. |
PdfFont | font | The font of item. |
PdfStringFormat | format | The string format. |
Examples
//Create a new instance of PdfDocument class.
PdfDocument document = new PdfDocument();
//Add a new page to the document.
PdfPage page = document.Pages.Add();
//Get the PDF page graphics.
PdfGraphics graphics = page.Graphics;
SizeF size = page.Graphics.ClientSize;
//Create font
PdfFont font = new PdfStandardFont(PdfFontFamily.TimesRoman, 10, PdfFontStyle.Italic);
//Create string format
PdfStringFormat format = new PdfStringFormat();
format.LineSpacing = 10f;
//Create a new list.
PdfOrderedList list = new PdfOrderedList();
//Create new PDF list items.
PdfListItem item1 = new PdfListItem("PDF", font, format);
PdfListItem item2 = new PdfListItem("XlsIO", font, format);
list.Items.Add(item1);
list.Items.Add(item2);
//Draw the PDF list to page.
list.Draw(page, new RectangleF(0, 20, size.Width, size.Height));
// Save and close the document.
document.Save("Output.pdf");
document.Close(true);
'Create a new instance of PdfDocument class.
Dim document As New PdfDocument()
'Add a new page to the document.
Dim page As PdfPage = document.Pages.Add()
'Get the PDF page graphics.
Dim graphics As PdfGraphics = page.Graphics
Dim size As SizeF = page.Graphics.ClientSize
'Create font
Dim font As PdfFont = New PdfStandardFont(PdfFontFamily.TimesRoman, 10, PdfFontStyle.Italic)
'Create string format
Dim format As New PdfStringFormat()
format.LineSpacing = 10F
'Create a new list.
Dim list As New PdfOrderedList()
'Create new PDF list items.
Dim item1 As New PdfListItem("PDF", font, format)
Dim item2 As New PdfListItem("XlsIO", font, format)
list.Items.Add(item1)
list.Items.Add(item2)
'Draw the PDF list to page.
list.Draw(page, New RectangleF(0, 20, size.Width, size.Height))
' Save and close the document.
document.Save("Output.pdf")
document.Close(True)
PdfListItem(String, PdfFont, PdfStringFormat, PdfPen, PdfBrush)
Creates new list item.
Declaration
public PdfListItem(string text, PdfFont font, PdfStringFormat format, PdfPen pen, PdfBrush brush)
Parameters
Type | Name | Description |
---|---|---|
System.String | text | The item text. |
PdfFont | font | The item font. |
PdfStringFormat | format | The string format of item. |
PdfPen | pen | The item pen. |
PdfBrush | brush | The item brush. |
Examples
//Create a new instance of PdfDocument class.
PdfDocument document = new PdfDocument();
//Add a new page to the document.
PdfPage page = document.Pages.Add();
//Get the PDF page graphics.
PdfGraphics graphics = page.Graphics;
SizeF size = page.Graphics.ClientSize;
//Create font
PdfFont font = new PdfStandardFont(PdfFontFamily.TimesRoman, 10, PdfFontStyle.Italic);
//Create string format
PdfStringFormat format = new PdfStringFormat();
format.LineSpacing = 10f;
//Create a new list.
PdfOrderedList list = new PdfOrderedList();
//Create new PDF list items.
PdfListItem item1 = new PdfListItem("PDF", font, format, PdfPens.Red, PdfBrushes.Black);
PdfListItem item2 = new PdfListItem("XlsIO", font, format, PdfPens.Red, PdfBrushes.Black);
list.Items.Add(item1);
list.Items.Add(item2);
//Draw the PDF list to page.
list.Draw(page, new RectangleF(0, 20, size.Width, size.Height));
// Save and close the document.
document.Save("Output.pdf");
document.Close(true);
'Create a new instance of PdfDocument class.
Dim document As New PdfDocument()
'Add a new page to the document.
Dim page As PdfPage = document.Pages.Add()
'Get the PDF page graphics.
Dim graphics As PdfGraphics = page.Graphics
Dim size As SizeF = page.Graphics.ClientSize
'Create font
Dim font As PdfFont = New PdfStandardFont(PdfFontFamily.TimesRoman, 10, PdfFontStyle.Italic)
'Create string format
Dim format As New PdfStringFormat()
format.LineSpacing = 10F
'Create a new list.
Dim list As New PdfOrderedList()
'Create new PDF list items.
Dim item1 As New PdfListItem("PDF", font, format, PdfPens.Red, PdfBrushes.Black)
Dim item2 As New PdfListItem("XlsIO", font, format, PdfPens.Red, PdfBrushes.Black)
list.Items.Add(item1)
list.Items.Add(item2)
'Draw the PDF list to page.
list.Draw(page, New RectangleF(0, 20, size.Width, size.Height))
' Save and close the document.
document.Save("Output.pdf")
document.Close(True)
Properties
Brush
Gets or sets list item brush.
Declaration
public PdfBrush Brush { get; set; }
Property Value
Type | Description |
---|---|
PdfBrush |
Examples
//Create a new PDf document
PdfDocument document = new PdfDocument();
//Creates a new page and adds it as the last page of the document
PdfPage page = document.Pages.Add();
PdfGraphics graphics = page.Graphics;
string[] products = { "Tools", "Grid", "Chart", "Edit", "Diagram", "XlsIO", "Grouping", "Calculate", "PDF", "HTMLUI", "DocIO" };
// Creates an item collection
PdfListItemCollection listItemCollection = new PdfListItemCollection(products);
// Creates an item
PdfListItem item = new PdfListItem("Tools");
item.Font = new PdfStandardFont(PdfFontFamily.TimesRoman, 12);
// Creates Grid list item
PdfListItem gridItem = new PdfListItem("Grid");
gridItem.Brush = PdfBrushes.BlueViolet;
gridItem.Font = new PdfStandardFont(PdfFontFamily.TimesRoman, 12);
// Adding items in collection
listItemCollection.Add(item);
listItemCollection.Add(gridItem);
//Create a unordered list
PdfUnorderedList list = new PdfUnorderedList(listItemCollection);
//Set the marker style
list.Marker.Style = PdfUnorderedMarkerStyle.Disk;
list.Draw(page, new RectangleF(0, 130, page.Graphics.ClientSize.Width, page.Graphics.ClientSize.Height));
document.Save("List.pdf");
'Create a new PDf document
Dim document As PdfDocument = New PdfDocument()
'Create a page
Dim page As PdfPage = document.Pages.Add()
Dim graphics As PdfGraphics = page.Graphics
Dim products() As String = { "Tools", "Grid", "Chart", "Edit", "Diagram", "XlsIO", "Grouping", "Calculate", "PDF", "HTMLUI", "DocIO" }
' Creates an item collection
Dim listItemCollection As PdfListItemCollection = New PdfListItemCollection(products)
' Creates an item
Dim item As PdfListItem = New PdfListItem("Tools")
item.Font = New PdfStandardFont(PdfFontFamily.TimesRoman, 12)
' Creates Grid list item
Dim gridItem As PdfListItem = New PdfListItem("Grid")
gridItem.Font = New PdfStandardFont(PdfFontFamily.TimesRoman, 12)
gridItem.Brush = PdfBrushes.BlueViolet
' Adding items in collection
listItemCollection.Add(item)
listItemCollection.Add(gridItem)
'Create a unordered list
Dim list As PdfUnorderedList = New PdfUnorderedList(listItemCollection)
'Set the marker style
list.Marker.Style = PdfUnorderedMarkerStyle.Disk
list.Draw(page, New RectangleF(0, 130, page.Graphics.ClientSize.Width, page.Graphics.ClientSize.Height))
document.Save("List.pdf")
See Also
Font
Gets or sets item font.
Declaration
public PdfFont Font { get; set; }
Property Value
Type | Description |
---|---|
PdfFont |
Examples
//Create a new PDf document
PdfDocument document = new PdfDocument();
//Creates a new page and adds it as the last page of the document
PdfPage page = document.Pages.Add();
PdfGraphics graphics = page.Graphics;
string[] products = { "Tools", "Grid", "Chart", "Edit", "Diagram", "XlsIO", "Grouping", "Calculate", "PDF", "HTMLUI", "DocIO" };
// Creates an item collection
PdfListItemCollection listItemCollection = new PdfListItemCollection(products);
// Creates an item
PdfListItem item = new PdfListItem("Tools");
item.Font = new PdfStandardFont(PdfFontFamily.TimesRoman, 12);
// Creates Grid list item
PdfListItem gridItem = new PdfListItem("Grid");
gridItem.Font = new PdfStandardFont(PdfFontFamily.TimesRoman, 12);
// Adding items in collection
listItemCollection.Add(item);
listItemCollection.Add(gridItem);
//Create a unordered list
PdfUnorderedList list = new PdfUnorderedList(listItemCollection);
//Set the marker style
list.Marker.Style = PdfUnorderedMarkerStyle.Disk;
list.Draw(page, new RectangleF(0, 130, page.Graphics.ClientSize.Width, page.Graphics.ClientSize.Height));
document.Save("List.pdf");
'Create a new PDf document
Dim document As PdfDocument = New PdfDocument()
'Create a page
Dim page As PdfPage = document.Pages.Add()
Dim graphics As PdfGraphics = page.Graphics
Dim products() As String = { "Tools", "Grid", "Chart", "Edit", "Diagram", "XlsIO", "Grouping", "Calculate", "PDF", "HTMLUI", "DocIO" }
' Creates an item collection
Dim listItemCollection As PdfListItemCollection = New PdfListItemCollection(products)
' Creates an item
Dim item As PdfListItem = New PdfListItem("Tools")
item.Font = New PdfStandardFont(PdfFontFamily.TimesRoman, 12)
' Creates Grid list item
Dim gridItem As PdfListItem = New PdfListItem("Grid")
gridItem.Font = New PdfStandardFont(PdfFontFamily.TimesRoman, 12)
' Adding items in collection
listItemCollection.Add(item)
listItemCollection.Add(gridItem)
'Create a unordered list
Dim list As PdfUnorderedList = New PdfUnorderedList(listItemCollection)
'Set the marker style
list.Marker.Style = PdfUnorderedMarkerStyle.Disk
list.Draw(page, New RectangleF(0, 130, page.Graphics.ClientSize.Width, page.Graphics.ClientSize.Height))
document.Save("List.pdf")
See Also
PdfTag
Get or set the tag for the element
Declaration
public PdfTag PdfTag { get; set; }
Property Value
Type | Description |
---|---|
PdfTag |
Examples
//Create a new instance of PdfDocument class.
PdfDocument document = new PdfDocument();
//Add a new page to the document.
PdfPage page = document.Pages.Add();
//Get the PDF page graphics.
PdfGraphics graphics = page.Graphics;
SizeF size = page.Graphics.ClientSize;
//Create font
PdfFont font = new PdfStandardFont(PdfFontFamily.TimesRoman, 10, PdfFontStyle.Italic);
//Create string format
PdfStringFormat format = new PdfStringFormat();
format.LineSpacing = 10f;
//Create a new list.
PdfOrderedList list = new PdfOrderedList();
//Create new PDF list items.
PdfListItem item1 = new PdfListItem();
item1.Text = "PDF";
item1.PdfTag = new PdfStructureElement(PdfTagType.ListItem);
PdfListItem item2 = new PdfListItem();
item2.Text = "XlsIO";
item2.PdfTag = new PdfStructureElement(PdfTagType.ListItem);
list.Items.Add(item1);
list.Items.Add(item2);
//Draw the PDF list to page.
list.Draw(page, new RectangleF(0, 20, size.Width, size.Height));
// Save and close the document.
document.Save("Output.pdf");
document.Close(true);
'Create a new instance of PdfDocument class.
Dim document As New PdfDocument()
'Add a new page to the document.
Dim page As PdfPage = document.Pages.Add()
'Get the PDF page graphics.
Dim graphics As PdfGraphics = page.Graphics
Dim size As SizeF = page.Graphics.ClientSize
'Create font
Dim font As PdfFont = New PdfStandardFont(PdfFontFamily.TimesRoman, 10, PdfFontStyle.Italic)
'Create string format
Dim format As New PdfStringFormat()
format.LineSpacing = 10F
'Create a new list.
Dim list As New PdfOrderedList()
'Create new PDF list items.
Dim item1 As New PdfListItem()
item1.Text = "PDF"
item1.PdfTag = New PdfStructureElement(PdfTagType.ListItem)
Dim item2 As New PdfListItem()
item2.Text = "XlsIO"
item2.PdfTag = New PdfStructureElement(PdfTagType.ListItem)
list.Items.Add(item1)
list.Items.Add(item2)
'Draw the PDF list to page.
list.Draw(page, New RectangleF(0, 20, size.Width, size.Height))
' Save and close the document.
document.Save("Output.pdf")
document.Close(True)
Pen
Gets or sets list item pen.
Declaration
public PdfPen Pen { get; set; }
Property Value
Type | Description |
---|---|
PdfPen |
Examples
//Create a new PDf document
PdfDocument document = new PdfDocument();
//Creates a new page and adds it as the last page of the document
PdfPage page = document.Pages.Add();
PdfGraphics graphics = page.Graphics;
string[] products = { "Tools", "Grid", "Chart", "Edit", "Diagram", "XlsIO", "Grouping", "Calculate", "PDF", "HTMLUI", "DocIO" };
// Creates an item collection
PdfListItemCollection listItemCollection = new PdfListItemCollection(products);
// Creates an item
PdfListItem item = new PdfListItem("Tools");
item.Font = new PdfStandardFont(PdfFontFamily.TimesRoman, 12);
// Creates Grid list item
PdfListItem gridItem = new PdfListItem("Grid");
gridItem.Pen = new PdfPen(PdfBrushes.Blue);
gridItem.Font = new PdfStandardFont(PdfFontFamily.TimesRoman, 12);
// Adding items in collection
listItemCollection.Add(item);
listItemCollection.Add(gridItem);
//Create a unordered list
PdfUnorderedList list = new PdfUnorderedList(listItemCollection);
//Set the marker style
list.Marker.Style = PdfUnorderedMarkerStyle.Disk;
list.Draw(page, new RectangleF(0, 130, page.Graphics.ClientSize.Width, page.Graphics.ClientSize.Height));
document.Save("List.pdf");
'Create a new PDf document
Dim document As PdfDocument = New PdfDocument()
'Create a page
Dim page As PdfPage = document.Pages.Add()
Dim graphics As PdfGraphics = page.Graphics
Dim products() As String = { "Tools", "Grid", "Chart", "Edit", "Diagram", "XlsIO", "Grouping", "Calculate", "PDF", "HTMLUI", "DocIO" }
' Creates an item collection
Dim listItemCollection As PdfListItemCollection = New PdfListItemCollection(products)
' Creates an item
Dim item As PdfListItem = New PdfListItem("Tools")
item.Font = New PdfStandardFont(PdfFontFamily.TimesRoman, 12)
' Creates Grid list item
Dim gridItem As PdfListItem = New PdfListItem("Grid")
gridItem.Font = New PdfStandardFont(PdfFontFamily.TimesRoman, 12)
gridItem.Pen = New PdfPen(PdfBrushes.Blue)
' Adding items in collection
listItemCollection.Add(item)
listItemCollection.Add(gridItem)
'Create a unordered list
Dim list As PdfUnorderedList = New PdfUnorderedList(listItemCollection)
'Set the marker style
list.Marker.Style = PdfUnorderedMarkerStyle.Disk
list.Draw(page, New RectangleF(0, 130, page.Graphics.ClientSize.Width, page.Graphics.ClientSize.Height))
document.Save("List.pdf")
See Also
StringFormat
Gets or sets item string format.
Declaration
public PdfStringFormat StringFormat { get; set; }
Property Value
Type | Description |
---|---|
PdfStringFormat |
Examples
//Create a new PDf document
PdfDocument document = new PdfDocument();
//Creates a new page and adds it as the last page of the document
PdfPage page = document.Pages.Add();
PdfGraphics graphics = page.Graphics;
string[] products = { "Tools", "Grid", "Chart", "Edit", "Diagram", "XlsIO", "Grouping", "Calculate", "PDF", "HTMLUI", "DocIO" };
// Creates an item collection
PdfListItemCollection listItemCollection = new PdfListItemCollection(products);
// Creates an item
PdfListItem item = new PdfListItem("Tools");
item.Font = new PdfStandardFont(PdfFontFamily.TimesRoman, 12);
// Creates Grid list item
PdfListItem gridItem = new PdfListItem("Grid");
gridItem.StringFormat = new PdfStringFormat(PdfTextAlignment.Left);
gridItem.Font = new PdfStandardFont(PdfFontFamily.TimesRoman, 12);
// Adding items in collection
listItemCollection.Add(item);
listItemCollection.Add(gridItem);
//Create a unordered list
PdfUnorderedList list = new PdfUnorderedList(listItemCollection);
//Set the marker style
list.Marker.Style = PdfUnorderedMarkerStyle.Disk;
list.Draw(page, new RectangleF(0, 130, page.Graphics.ClientSize.Width, page.Graphics.ClientSize.Height));
document.Save("List.pdf");
'Create a new PDf document
Dim document As PdfDocument = New PdfDocument()
'Create a page
Dim page As PdfPage = document.Pages.Add()
Dim graphics As PdfGraphics = page.Graphics
Dim products() As String = { "Tools", "Grid", "Chart", "Edit", "Diagram", "XlsIO", "Grouping", "Calculate", "PDF", "HTMLUI", "DocIO" }
' Creates an item collection
Dim listItemCollection As PdfListItemCollection = New PdfListItemCollection(products)
' Creates an item
Dim item As PdfListItem = New PdfListItem("Tools")
item.Font = New PdfStandardFont(PdfFontFamily.TimesRoman, 12)
' Creates Grid list item
Dim gridItem As PdfListItem = New PdfListItem("Grid")
gridItem.Font = New PdfStandardFont(PdfFontFamily.TimesRoman, 12)
gridItem.StringFormat = New PdfStringFormat(PdfTextAlignment.Left)
' Adding items in collection
listItemCollection.Add(item)
listItemCollection.Add(gridItem)
'Create a unordered list
Dim list As PdfUnorderedList = New PdfUnorderedList(listItemCollection)
'Set the marker style
list.Marker.Style = PdfUnorderedMarkerStyle.Disk
list.Draw(page, New RectangleF(0, 130, page.Graphics.ClientSize.Width, page.Graphics.ClientSize.Height))
document.Save("List.pdf")
See Also
SubList
Gets or sets sublist for item.
Declaration
public PdfList SubList { get; set; }
Property Value
Type | Description |
---|---|
PdfList |
Examples
//Create a new PDf document
PdfDocument document = new PdfDocument();
//Creates a new page and adds it as the last page of the document
PdfPage page = document.Pages.Add();
PdfGraphics graphics = page.Graphics;
// Creates an item collection
PdfListItemCollection listItemCollection = new PdfListItemCollection();
// Creates an item
PdfListItem item = new PdfListItem("Backoffice");
item.Font = new PdfStandardFont(PdfFontFamily.TimesRoman, 12);
// Creates Grid list item
PdfListItem gridItem = new PdfListItem("Grid");
gridItem.Brush = PdfBrushes.BlueViolet;
gridItem.Font = new PdfStandardFont(PdfFontFamily.TimesRoman, 12);
// Adding items in collection
listItemCollection.Add(item);
listItemCollection.Add(gridItem);
//Create a unordered list
PdfUnorderedList list = new PdfUnorderedList(listItemCollection);
//Set the marker style
list.Marker.Style = PdfUnorderedMarkerStyle.Disk;
//Create Ordered list as sublist of parent list
PdfOrderedList subList = new PdfOrderedList();
subList.Marker.Brush = PdfBrushes.Black;
subList.Indent = 20;
subList.Items.Add("Essential PDF");
subList.Items.Add("Essential DocIO");
subList.Items.Add("Essrntial XlsIO");
list.Items[0].SubList = subList;
list.Draw(page, new RectangleF(0, 130, page.Graphics.ClientSize.Width, page.Graphics.ClientSize.Height));
document.Save("List.pdf");
'Create a new PDf document
Dim document As PdfDocument = New PdfDocument()
'Create a page
Dim page As PdfPage = document.Pages.Add()
Dim graphics As PdfGraphics = page.Graphics
' Creates an item collection
Dim listItemCollection As PdfListItemCollection = New PdfListItemCollection()
' Creates an item
Dim item As PdfListItem = New PdfListItem("Backoffice")
item.Font = New PdfStandardFont(PdfFontFamily.TimesRoman, 12)
' Creates Grid list item
Dim gridItem As PdfListItem = New PdfListItem("Grid")
gridItem.Brush = PdfBrushes.BlueViolet
gridItem.Font = New PdfStandardFont(PdfFontFamily.TimesRoman, 12)
' Adding items in collection
listItemCollection.Add(item)
listItemCollection.Add(gridItem)
'Create a unordered list
Dim list As PdfUnorderedList = New PdfUnorderedList(listItemCollection)
'Set the marker style
list.Marker.Style = PdfUnorderedMarkerStyle.Disk
'Create Ordered list as sublist of parent list
Dim subList As PdfOrderedList = New PdfOrderedList()
subList.Marker.Brush = PdfBrushes.Black
subList.Indent = 20
subList.Items.Add("Essential PDF")
subList.Items.Add("Essential DocIO")
subList.Items.Add("Essrntial XlsIO")
list.Items(0).SubList = subList
list.Draw(page, New RectangleF(0, 130, page.Graphics.ClientSize.Width, page.Graphics.ClientSize.Height))
document.Save("List.pdf")
See Also
Text
Gets or sets item text.
Declaration
public string Text { get; set; }
Property Value
Type | Description |
---|---|
System.String |
Examples
//Create a new PDf document
PdfDocument document = new PdfDocument();
//Creates a new page and adds it as the last page of the document
PdfPage page = document.Pages.Add();
PdfGraphics graphics = page.Graphics;
string[] products = { "Tools", "Grid", "Chart", "Edit", "Diagram", "XlsIO", "Grouping", "Calculate", "PDF", "HTMLUI", "DocIO" };
// Creates an item collection
PdfListItemCollection listItemCollection = new PdfListItemCollection(products);
// Creates an item
PdfListItem item = new PdfListItem("Tools");
item.Font = new PdfStandardFont(PdfFontFamily.TimesRoman, 12);
// Creates Grid list item
PdfListItem gridItem = new PdfListItem("Grid");
gridItem.Text = "Grid";
gridItem.Font = new PdfStandardFont(PdfFontFamily.TimesRoman, 12);
// Adding items in collection
listItemCollection.Add(item);
listItemCollection.Add(gridItem);
//Create a unordered list
PdfUnorderedList list = new PdfUnorderedList(listItemCollection);
//Set the marker style
list.Marker.Style = PdfUnorderedMarkerStyle.Disk;
list.Draw(page, new RectangleF(0, 130, page.Graphics.ClientSize.Width, page.Graphics.ClientSize.Height));
document.Save("List.pdf");
'Create a new PDf document
Dim document As PdfDocument = New PdfDocument()
'Create a page
Dim page As PdfPage = document.Pages.Add()
Dim graphics As PdfGraphics = page.Graphics
Dim products() As String = { "Tools", "Grid", "Chart", "Edit", "Diagram", "XlsIO", "Grouping", "Calculate", "PDF", "HTMLUI", "DocIO" }
' Creates an item collection
Dim listItemCollection As PdfListItemCollection = New PdfListItemCollection(products)
' Creates an item
Dim item As PdfListItem = New PdfListItem("Tools")
item.Font = New PdfStandardFont(PdfFontFamily.TimesRoman, 12)
' Creates Grid list item
Dim gridItem As PdfListItem = New PdfListItem("Grid")
gridItem.Font = New PdfStandardFont(PdfFontFamily.TimesRoman, 12)
gridItem.Text = "Grid"
' Adding items in collection
listItemCollection.Add(item)
listItemCollection.Add(gridItem)
'Create a unordered list
Dim list As PdfUnorderedList = New PdfUnorderedList(listItemCollection)
'Set the marker style
list.Marker.Style = PdfUnorderedMarkerStyle.Disk
list.Draw(page, New RectangleF(0, 130, page.Graphics.ClientSize.Width, page.Graphics.ClientSize.Height))
document.Save("List.pdf")
See Also
TextIndent
Gets or sets indent for item.
Declaration
public float TextIndent { get; set; }
Property Value
Type | Description |
---|---|
System.Single |
Examples
//Create a new PDf document
PdfDocument document = new PdfDocument();
//Creates a new page and adds it as the last page of the document
PdfPage page = document.Pages.Add();
PdfGraphics graphics = page.Graphics;
// Creates an item collection
PdfListItemCollection listItemCollection = new PdfListItemCollection();
// Creates an item
PdfListItem item = new PdfListItem("Backoffice");
item.Font = new PdfStandardFont(PdfFontFamily.TimesRoman, 12);
// Creates Grid list item
PdfListItem gridItem = new PdfListItem("Grid");
gridItem.TextIndent = 10;
gridItem.Font = new PdfStandardFont(PdfFontFamily.TimesRoman, 12);
// Adding items in collection
listItemCollection.Add(item);
listItemCollection.Add(gridItem);
//Create a unordered list
PdfUnorderedList list = new PdfUnorderedList(listItemCollection);
//Set the marker style
list.Marker.Style = PdfUnorderedMarkerStyle.Disk;
//Create Ordered list as sublist of parent list
PdfOrderedList subList = new PdfOrderedList();
subList.Marker.Brush = PdfBrushes.Black;
subList.Indent = 20;
subList.Items.Add("Essential PDF");
subList.Items.Add("Essential DocIO");
subList.Items.Add("Essrntial XlsIO");
list.Items[0].SubList = subList;
list.Draw(page, new RectangleF(0, 130, page.Graphics.ClientSize.Width, page.Graphics.ClientSize.Height));
document.Save("List.pdf");
'Create a new PDf document
Dim document As PdfDocument = New PdfDocument()
'Create a page
Dim page As PdfPage = document.Pages.Add()
Dim graphics As PdfGraphics = page.Graphics
' Creates an item collection
Dim listItemCollection As PdfListItemCollection = New PdfListItemCollection()
' Creates an item
Dim item As PdfListItem = New PdfListItem("Backoffice")
item.Font = New PdfStandardFont(PdfFontFamily.TimesRoman, 12)
' Creates Grid list item
Dim gridItem As PdfListItem = New PdfListItem("Grid")
gridItem.TextIndent = 10
gridItem.Font = New PdfStandardFont(PdfFontFamily.TimesRoman, 12)
' Adding items in collection
listItemCollection.Add(item)
listItemCollection.Add(gridItem)
'Create a unordered list
Dim list As PdfUnorderedList = New PdfUnorderedList(listItemCollection)
'Set the marker style
list.Marker.Style = PdfUnorderedMarkerStyle.Disk
'Create Ordered list as sublist of parent list
Dim subList As PdfOrderedList = New PdfOrderedList()
subList.Marker.Brush = PdfBrushes.Black
subList.Indent = 20
subList.Items.Add("Essential PDF")
subList.Items.Add("Essential DocIO")
subList.Items.Add("Essrntial XlsIO")
list.Items(0).SubList = subList
list.Draw(page, New RectangleF(0, 130, page.Graphics.ClientSize.Width, page.Graphics.ClientSize.Height))
document.Save("List.pdf")