Class PdfListItem
- Namespace
- Syncfusion.Pdf.Lists
- Assembly
- Syncfusion.Pdf.Portable.dll
Represents the list item of the list.
public class PdfListItem
- Inheritance
-
PdfListItem
- Inherited Members
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.
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)
- See Also
PdfListItem(string)
Creates new pdf list item with default settings.
public PdfListItem(string text)
Parameters
text
string
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)
- See Also
PdfListItem(string, PdfFont)
Initializes a new instance of the PdfListItem class.
public PdfListItem(string text, PdfFont font)
Parameters
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)
- See Also
PdfListItem(string, PdfFont, PdfStringFormat)
Initializes a new instance of the PdfListItem class.
public PdfListItem(string text, PdfFont font, PdfStringFormat format)
Parameters
text
stringThe text of item.
font
PdfFontThe font of item.
format
PdfStringFormatThe 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)
- See Also
PdfListItem(string, PdfFont, PdfStringFormat, PdfPen, PdfBrush)
Creates new list item.
public PdfListItem(string text, PdfFont font, PdfStringFormat format, PdfPen pen, PdfBrush brush)
Parameters
text
stringThe item text.
font
PdfFontThe item font.
format
PdfStringFormatThe string format of item.
pen
PdfPenThe item pen.
brush
PdfBrushThe 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)
- See Also
Properties
Brush
Gets or sets list item brush.
public PdfBrush Brush { get; set; }
Property Value
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.
public PdfFont Font { get; set; }
Property Value
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
public PdfTag PdfTag { get; set; }
Property Value
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)
- See Also
Pen
Gets or sets list item pen.
public PdfPen Pen { get; set; }
Property Value
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.
public PdfStringFormat StringFormat { get; set; }
Property Value
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.
public PdfList SubList { get; set; }
Property Value
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.
public string Text { get; set; }
Property Value
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.
public float TextIndent { get; set; }
Property Value
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")
- See Also