Class PdfOrderedList
- Namespace
- Syncfusion.Pdf.Lists
- Assembly
- Syncfusion.Pdf.Portable.dll
Represents the ordered list.
public class PdfOrderedList : PdfList
- Inheritance
-
PdfOrderedList
- 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;
//Create a font and write title
PdfFont font = new PdfStandardFont(PdfFontFamily.Helvetica, 14,PdfFontStyle.Bold);
//Create a unordered list
PdfOrderedMarker list = new PdfOrderedMarker(PdfNumberStyle.LowerRoman, font);
//Create Ordered list as sublist of parent list
PdfOrderedList subList = new PdfOrderedList();
subList.Marker = list;
//Add items to the list
subList.Items.Add("List of Essential Studio products");
subList.Items.Add("IO products");
subList.Items.Add("Grid products");
subList.Items.Add("Tools products");
//Draw list
subList.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
'Create a font and write title
Dim font As PdfFont = New PdfStandardFont(PdfFontFamily.Helvetica, 14,PdfFontStyle.Bold)
'Create a unordered list
Dim list As PdfOrderedMarker = New PdfOrderedMarker(PdfNumberStyle.LowerRoman, font)
'Create Ordered list as sublist of parent list
Dim subList As PdfOrderedList = New PdfOrderedList()
subList.Marker = list
'Add items to the list
subList.Items.Add("List of Essential Studio products")
subList.Items.Add("IO products")
subList.Items.Add("Grid products")
subList.Items.Add("Tools products")
'Draw list
subList.Draw(page, New RectangleF(0, 130, page.Graphics.ClientSize.Width, page.Graphics.ClientSize.Height))
document.Save("List.pdf")
Constructors
PdfOrderedList()
Initialize a new instance of the PdfOrderedList class.
public PdfOrderedList()
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 Ordered list
PdfOrderedList list = new PdfOrderedList();
//Create new order list marker.
PdfOrderedMarker marker = new PdfOrderedMarker(PdfNumberStyle.Numeric, font);
//Set marker brush.
marker.Brush = PdfBrushes.Black;
//Set marker to the ordered list.
list.Marker = marker;
//Set line indent.
list.Indent = 20;
//Set format for sub list.
list.Font = font;
list.StringFormat = format;
//Add items to the list
list.Items.Add("PDF");
list.Items.Add("XlsIO");
list.Items.Add("DocIO");
list.Items.Add("PPT");
//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 Ordered list
Dim list As New PdfOrderedList()
'Create new order list marker.
Dim marker As New PdfOrderedMarker(PdfNumberStyle.Numeric, font)
'Set marker brush.
marker.Brush = PdfBrushes.Black
'Set marker to the ordered list.
list.Marker = marker
'Set line indent.
list.Indent = 20
'Set format for sub list
list.Font = font
list.StringFormat = format
'Add items to the list
list.Items.Add("PDF")
list.Items.Add("XlsIO")
list.Items.Add("DocIO")
list.Items.Add("PPT")
'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
PdfOrderedList(PdfFont)
Initializes a new instance of the PdfOrderedList class.
public PdfOrderedList(PdfFont font)
Parameters
font
PdfFontThe font.
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 Ordered list
PdfOrderedList list = new PdfOrderedList(font);
//Create new order list marker.
PdfOrderedMarker marker = new PdfOrderedMarker(PdfNumberStyle.Numeric, font);
//Set marker brush.
marker.Brush = PdfBrushes.Black;
//Set marker to the ordered list.
list.Marker = marker;
//Set line indent.
list.Indent = 20;
//Set format for sub list.
list.Font = font;
list.StringFormat = format;
//Add items to the list
list.Items.Add("PDF");
list.Items.Add("XlsIO");
list.Items.Add("DocIO");
list.Items.Add("PPT");
//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 Ordered list
Dim list As New PdfOrderedList(font)
'Create new order list marker.
Dim marker As New PdfOrderedMarker(PdfNumberStyle.Numeric, font)
'Set marker brush.
marker.Brush = PdfBrushes.Black
'Set marker to the ordered list.
list.Marker = marker
'Set line indent.
list.Indent = 20
'Set format for sub list
list.Font = font
list.StringFormat = format
'Add items to the list
list.Items.Add("PDF")
list.Items.Add("XlsIO")
list.Items.Add("DocIO")
list.Items.Add("PPT")
'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
PdfOrderedList(PdfListItemCollection)
Creates ordered list using items.
public PdfOrderedList(PdfListItemCollection items)
Parameters
items
PdfListItemCollectionItems for a list.
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 new PDF list item instance.
PdfListItemCollection collection = new PdfListItemCollection();
collection.Add("PDF");
collection.Add("XlsIO");
collection.Add("DocIO");
collection.Add("PPT");
//Create Ordered list
PdfOrderedList list = new PdfOrderedList(collection);
//Set line indent.
list.Indent = 20;
//Set format for sub list.
list.Font = font;
list.StringFormat = format;
//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 new PDF list item instance.
Dim collection As New PdfListItemCollection()
collection.Add("PDF")
collection.Add("XlsIO")
collection.Add("DocIO")
collection.Add("PPT")
'Create Ordered list
Dim list As New PdfOrderedList(collection)
'Set line indent.
list.Indent = 20
'Set format for sub list
list.Font = font
list.StringFormat = format
'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
PdfOrderedList(PdfListItemCollection, PdfOrderedMarker)
Initializes a new instance of the PdfOrderedList class.
public PdfOrderedList(PdfListItemCollection items, PdfOrderedMarker marker)
Parameters
items
PdfListItemCollectionThe item collection.
marker
PdfOrderedMarkerThe marker for the list.
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 new order list marker.
PdfOrderedMarker marker = new PdfOrderedMarker(PdfNumberStyle.Numeric, font);
//Set marker brush.
marker.Brush = PdfBrushes.Black;
//Create new PDF list item instance.
PdfListItemCollection collection = new PdfListItemCollection();
collection.Add("PDF");
collection.Add("XlsIO");
collection.Add("DocIO");
collection.Add("PPT");
//Create Ordered list
PdfOrderedList list = new PdfOrderedList(collection, marker);
//Set line indent.
list.Indent = 20;
//Set format for sub list.
list.Font = font;
list.StringFormat = format;
//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 new order list marker.
Dim marker As New PdfOrderedMarker(PdfNumberStyle.Numeric, font)
'Set marker brush.
marker.Brush = PdfBrushes.Black
'Create new PDF list item instance.
Dim collection As New PdfListItemCollection()
collection.Add("PDF")
collection.Add("XlsIO")
collection.Add("DocIO")
collection.Add("PPT")
'Create Ordered list
Dim list As New PdfOrderedList(collection, marker)
'Set line indent.
list.Indent = 20
'Set format for sub list
list.Font = font
list.StringFormat = format
'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
PdfOrderedList(PdfOrderedMarker)
Initializes a new instance of the PdfOrderedList class.
public PdfOrderedList(PdfOrderedMarker marker)
Parameters
marker
PdfOrderedMarkerThe marker for the list.
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 new order list marker.
PdfOrderedMarker marker = new PdfOrderedMarker(PdfNumberStyle.Numeric, font);
//Set marker brush.
marker.Brush = PdfBrushes.Black;
//Create Ordered list
PdfOrderedList list = new PdfOrderedList(marker);
//Set line indent.
list.Indent = 20;
//Set format for sub list.
list.Font = font;
list.StringFormat = format;
//Add items to the list
list.Items.Add("PDF");
list.Items.Add("XlsIO");
list.Items.Add("DocIO");
list.Items.Add("PPT");
//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 new order list marker.
Dim marker As New PdfOrderedMarker(PdfNumberStyle.Numeric, font)
'Set marker brush.
marker.Brush = PdfBrushes.Black
'Create Ordered list
Dim list As New PdfOrderedList()
'Set line indent.
list.Indent = 20
'Set format for sub list
list.Font = font
list.StringFormat = format
'Add items to the list
list.Items.Add("PDF")
list.Items.Add("XlsIO")
list.Items.Add("DocIO")
list.Items.Add("PPT")
'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
PdfOrderedList(PdfNumberStyle)
Initializes a new instance of the PdfOrderedList class.
public PdfOrderedList(PdfNumberStyle style)
Parameters
style
PdfNumberStyleThe style.
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 Ordered list
PdfOrderedList list = new PdfOrderedList(PdfNumberStyle.Numeric);
//Set line indent.
list.Indent = 20;
//Set format for sub list.
list.Font = font;
list.StringFormat = format;
//Add items to the list
list.Items.Add("PDF");
list.Items.Add("XlsIO");
list.Items.Add("DocIO");
list.Items.Add("PPT");
//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 Ordered list
Dim list As New PdfOrderedList(PdfNumberStyle.Numeric)
'Set line indent.
list.Indent = 20
'Set format for sub list
list.Font = font
list.StringFormat = format
'Add items to the list
list.Items.Add("PDF")
list.Items.Add("XlsIO")
list.Items.Add("DocIO")
list.Items.Add("PPT")
'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
PdfOrderedList(string)
Initializes a new instance of the PdfOrderedList class.
public PdfOrderedList(string text)
Parameters
text
stringThe formatted 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;
string text = "PDF\nXlsIO\nDocIO\nPPT";
//Create Ordered list
PdfOrderedList list = new PdfOrderedList(text);
//Set line indent.
list.Indent = 20;
//Set format for sub list.
list.Font = font;
list.StringFormat = format;
//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 new PDF list item instance.
Dim text As String = "PDF" + vbLf + "XlsIO" + vbLf + "DocIO" + vbLf + "PPT"
'Create Ordered list
Dim list As New PdfOrderedList(collection)
'Set line indent.
list.Indent = 20
'Set format for sub list
list.Font = font
list.StringFormat = format
'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
PdfOrderedList(string, PdfOrderedMarker)
Initializes a new instance of the PdfOrderedList class from formatted text that is splitted by new lines.
public PdfOrderedList(string text, PdfOrderedMarker marker)
Parameters
text
stringThe formatted text.
marker
PdfOrderedMarkerThe marker.
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;
string text = "PDF\nXlsIO\nDocIO\nPPT";
//Create new order list marker.
PdfOrderedMarker marker = new PdfOrderedMarker(PdfNumberStyle.Numeric, font);
//Set marker brush.
marker.Brush = PdfBrushes.Black;
//Create Ordered list
PdfOrderedList list = new PdfOrderedList(text, marker);
//Set line indent.
list.Indent = 20;
//Set format for sub list.
list.Font = font;
list.StringFormat = format;
//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 new PDF list item instance.
Dim text As String = "PDF" + vbLf + "XlsIO" + vbLf + "DocIO" + vbLf + "PPT"
'Create new order list marker.
Dim marker As New PdfOrderedMarker(PdfNumberStyle.Numeric, font)
'Set marker brush.
marker.Brush = PdfBrushes.Black
'Create Ordered list
Dim list As New PdfOrderedList(collection, marker)
'Set line indent.
list.Indent = 20
'Set format for sub list
list.Font = font
list.StringFormat = format
'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
Marker
Gets or sets marker of the list items.
public PdfOrderedMarker Marker { 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;
//Create a font and write title
PdfFont font = new PdfStandardFont(PdfFontFamily.Helvetica, 14,PdfFontStyle.Bold);
//Create a unordered list
PdfOrderedMarker list = new PdfOrderedMarker(PdfNumberStyle.LowerRoman, font);
//Create Ordered list as sublist of parent list
PdfOrderedList subList = new PdfOrderedList();
subList.Marker = list;
//Add items to the list
subList.Items.Add("List of Essential Studio products");
subList.Items.Add("IO products");
subList.Items.Add("Grid products");
subList.Items.Add("Tools products");
//Draw list
subList.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
'Create a font and write title
Dim font As PdfFont = New PdfStandardFont(PdfFontFamily.Helvetica, 14,PdfFontStyle.Bold)
'Create a unordered list
Dim list As PdfOrderedMarker = New PdfOrderedMarker(PdfNumberStyle.LowerRoman, font)
'Create Ordered list as sublist of parent list
Dim subList As PdfOrderedList = New PdfOrderedList()
subList.Marker = list
'Add items to the list
subList.Items.Add("List of Essential Studio products")
subList.Items.Add("IO products")
subList.Items.Add("Grid products")
subList.Items.Add("Tools products")
'Draw list
subList.Draw(page, New RectangleF(0, 130, page.Graphics.ClientSize.Width, page.Graphics.ClientSize.Height))
document.Save("List.pdf")
- See Also
MarkerHierarchy
True if user want to use numbering hierarchy, otherwise false.
public bool MarkerHierarchy { 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;
//Create a font and write title
PdfFont font = new PdfStandardFont(PdfFontFamily.Helvetica, 14,PdfFontStyle.Bold);
//Create a unordered list
PdfOrderedMarker list = new PdfOrderedMarker(PdfNumberStyle.LowerRoman, font);
//Create Ordered list as sublist of parent list
PdfOrderedList subList = new PdfOrderedList();
subList.Marker = list;
subList.MarkerHierarchy = true;
//Add items to the list
subList.Items.Add("List of Essential Studio products");
subList.Items.Add("IO products");
subList.Items.Add("Grid products");
subList.Items.Add("Tools products");
//Draw list
subList.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
'Create a font and write title
Dim font As PdfFont = New PdfStandardFont(PdfFontFamily.Helvetica, 14,PdfFontStyle.Bold)
'Create a unordered list
Dim list As PdfOrderedMarker = New PdfOrderedMarker(PdfNumberStyle.LowerRoman, font)
'Create Ordered list as sublist of parent list
Dim subList As PdfOrderedList = New PdfOrderedList()
subList.Marker = list
subList.MarkerHierarchy = True
'Add items to the list
subList.Items.Add("List of Essential Studio products")
subList.Items.Add("IO products")
subList.Items.Add("Grid products")
subList.Items.Add("Tools products")
'Draw list
subList.Draw(page, New RectangleF(0, 130, page.Graphics.ClientSize.Width, page.Graphics.ClientSize.Height))
document.Save("List.pdf")
- See Also