Class PdfList
- Namespace
- Syncfusion.Pdf.Lists
- Assembly
- Syncfusion.Pdf.Portable.dll
Represents base class for lists.
public abstract class PdfList : PdfLayoutElement
- Inheritance
-
PdfList
- Derived
- Inherited Members
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();
//Set indent.
list.Indent = 10;
//Set text indent.
list.TextIndent = 10;
//Set font.
list.Font = font;
//Set brush.
list.Brush = new PdfSolidBrush(Color.Red);
//Set pen.
list.Pen = PdfPens.Green;
//Set string format.
list.StringFormat = format;
//Add items.
list.Items.Add("PDF");
list.Items.Add("XlsIO");
list.Items.Add("DocIO");
//Draw the PDF list to page.
list.Draw(graphics, 10,10);
// 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 = 10.0F
'Create a new list.
Dim list As New PdfOrderedList()
'Set indent.
list.Indent = 10
'Set text indent.
list.TextIndent = 10
'Set font.
list.Font = font
'Set brush.
list.Brush = New PdfSolidBrush(Color.Red)
'Set pen.
list.Pen = PdfPens.Green
'Set string format.
list.StringFormat = format
'Add items.
list.Items.Add("PDF")
list.Items.Add("XlsIO")
list.Items.Add("DocIO")
'Draw the PDF list to page.
list.Draw(graphics, 10, 10)
' Save and close the document.
document.Save("Output.pdf")
document.Close(True)
Fields
c_splitChars
The characters for splitting.
protected static readonly char[] c_splitChars
Field Value
- char[]
- See Also
Properties
Brush
Gets or sets list brush.
public PdfBrush Brush { 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();
//Set indent.
list.Indent = 10;
//Set text indent.
list.TextIndent = 10;
//Set font.
list.Font = font;
//Set brush.
list.Brush = new PdfSolidBrush(Color.Red);
//Set pen.
list.Pen = PdfPens.Green;
//Set string format.
list.StringFormat = format;
//Add items.
list.Items.Add("PDF");
list.Items.Add("XlsIO");
list.Items.Add("DocIO");
//Draw the PDF list to page.
list.Draw(graphics, 10,10);
// 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 = 10.0F
'Create a new list.
Dim list As New PdfOrderedList()
'Set indent.
list.Indent = 10
'Set text indent.
list.TextIndent = 10
'Set font.
list.Font = font
'Set brush.
list.Brush = New PdfSolidBrush(Color.Red)
'Set pen.
list.Pen = PdfPens.Green
'Set string format.
list.StringFormat = format
'Add items.
list.Items.Add("PDF")
list.Items.Add("XlsIO")
list.Items.Add("DocIO")
'Draw the PDF list to page.
list.Draw(graphics, 10, 10)
' Save and close the document.
document.Save("Output.pdf")
document.Close(True)
- See Also
Font
Gets or sets the list font.
public PdfFont Font { 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();
//Set indent.
list.Indent = 10;
//Set text indent.
list.TextIndent = 10;
//Set font.
list.Font = font;
//Set brush.
list.Brush = new PdfSolidBrush(Color.Red);
//Set pen.
list.Pen = PdfPens.Green;
//Set string format.
list.StringFormat = format;
//Add items.
list.Items.Add("PDF");
list.Items.Add("XlsIO");
list.Items.Add("DocIO");
//Draw the PDF list to page.
list.Draw(graphics, 10,10);
// 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 = 10.0F
'Create a new list.
Dim list As New PdfOrderedList()
'Set indent.
list.Indent = 10
'Set text indent.
list.TextIndent = 10
'Set font.
list.Font = font
'Set brush.
list.Brush = New PdfSolidBrush(Color.Red)
'Set pen.
list.Pen = PdfPens.Green
'Set string format.
list.StringFormat = format
'Add items.
list.Items.Add("PDF")
list.Items.Add("XlsIO")
list.Items.Add("DocIO")
'Draw the PDF list to page.
list.Draw(graphics, 10, 10)
' Save and close the document.
document.Save("Output.pdf")
document.Close(True)
- See Also
Indent
Gets or sets tabulation for the list.
public float Indent { 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();
//Set indent.
list.Indent = 10;
//Set text indent.
list.TextIndent = 10;
//Set font.
list.Font = font;
//Set brush.
list.Brush = new PdfSolidBrush(Color.Red);
//Set pen.
list.Pen = PdfPens.Green;
//Set string format.
list.StringFormat = format;
//Add items.
list.Items.Add("PDF");
list.Items.Add("XlsIO");
list.Items.Add("DocIO");
//Draw the PDF list to page.
list.Draw(graphics, 10,10);
// 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 = 10.0F
'Create a new list.
Dim list As New PdfOrderedList()
'Set indent.
list.Indent = 10
'Set text indent.
list.TextIndent = 10
'Set font.
list.Font = font
'Set brush.
list.Brush = New PdfSolidBrush(Color.Red)
'Set pen.
list.Pen = PdfPens.Green
'Set string format.
list.StringFormat = format
'Add items.
list.Items.Add("PDF")
list.Items.Add("XlsIO")
list.Items.Add("DocIO")
'Draw the PDF list to page.
list.Draw(graphics, 10, 10)
' Save and close the document.
document.Save("Output.pdf")
document.Close(True)
- See Also
Items
Gets items of the list.
public PdfListItemCollection Items { get; }
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();
//Set indent.
list.Indent = 10;
//Set text indent.
list.TextIndent = 10;
//Set font.
list.Font = font;
//Set brush.
list.Brush = new PdfSolidBrush(Color.Red);
//Set pen.
list.Pen = PdfPens.Green;
//Set string format.
list.StringFormat = format;
//Add items.
list.Items.Add("PDF");
list.Items.Add("XlsIO");
list.Items.Add("DocIO");
//Draw the PDF list to page.
list.Draw(graphics, 10,10);
// 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 = 10.0F
'Create a new list.
Dim list As New PdfOrderedList()
'Set indent.
list.Indent = 10
'Set text indent.
list.TextIndent = 10
'Set font.
list.Font = font
'Set brush.
list.Brush = New PdfSolidBrush(Color.Red)
'Set pen.
list.Pen = PdfPens.Green
'Set string format.
list.StringFormat = format
'Add items.
list.Items.Add("PDF")
list.Items.Add("XlsIO")
list.Items.Add("DocIO")
'Draw the PDF list to page.
list.Draw(graphics, 10, 10)
' Save and close the document.
document.Save("Output.pdf")
document.Close(True)
- See Also
Pen
Gets or sets list pen.
public PdfPen Pen { 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();
//Set indent.
list.Indent = 10;
//Set text indent.
list.TextIndent = 10;
//Set font.
list.Font = font;
//Set brush.
list.Brush = new PdfSolidBrush(Color.Red);
//Set pen.
list.Pen = PdfPens.Green;
//Set string format.
list.StringFormat = format;
//Add items.
list.Items.Add("PDF");
list.Items.Add("XlsIO");
list.Items.Add("DocIO");
//Draw the PDF list to page.
list.Draw(graphics, 10,10);
// 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 = 10.0F
'Create a new list.
Dim list As New PdfOrderedList()
'Set indent.
list.Indent = 10
'Set text indent.
list.TextIndent = 10
'Set font.
list.Font = font
'Set brush.
list.Brush = New PdfSolidBrush(Color.Red)
'Set pen.
list.Pen = PdfPens.Green
'Set string format.
list.StringFormat = format
'Add items.
list.Items.Add("PDF")
list.Items.Add("XlsIO")
list.Items.Add("DocIO")
'Draw the PDF list to page.
list.Draw(graphics, 10, 10)
' Save and close the document.
document.Save("Output.pdf")
document.Close(True)
- See Also
StringFormat
Gets or sets the format of the list.
public PdfStringFormat StringFormat { get; set; }
Property Value
- PdfStringFormat
The 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();
//Set indent.
list.Indent = 10;
//Set text indent.
list.TextIndent = 10;
//Set font.
list.Font = font;
//Set brush.
list.Brush = new PdfSolidBrush(Color.Red);
//Set pen.
list.Pen = PdfPens.Green;
//Set string format.
list.StringFormat = format;
//Add items.
list.Items.Add("PDF");
list.Items.Add("XlsIO");
list.Items.Add("DocIO");
//Draw the PDF list to page.
list.Draw(graphics, 10,10);
// 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 = 10.0F
'Create a new list.
Dim list As New PdfOrderedList()
'Set indent.
list.Indent = 10
'Set text indent.
list.TextIndent = 10
'Set font.
list.Font = font
'Set brush.
list.Brush = New PdfSolidBrush(Color.Red)
'Set pen.
list.Pen = PdfPens.Green
'Set string format.
list.StringFormat = format
'Add items.
list.Items.Add("PDF")
list.Items.Add("XlsIO")
list.Items.Add("DocIO")
'Draw the PDF list to page.
list.Draw(graphics, 10, 10)
' Save and close the document.
document.Save("Output.pdf")
document.Close(True)
- See Also
TextIndent
Gets or sets the indent from the marker to the list item text.
public float TextIndent { 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();
//Set indent.
list.Indent = 10;
//Set text indent.
list.TextIndent = 10;
//Set font.
list.Font = font;
//Set brush.
list.Brush = new PdfSolidBrush(Color.Red);
//Set pen.
list.Pen = PdfPens.Green;
//Set string format.
list.StringFormat = format;
//Add items.
list.Items.Add("PDF");
list.Items.Add("XlsIO");
list.Items.Add("DocIO");
//Draw the PDF list to page.
list.Draw(graphics, 10,10);
// 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 = 10.0F
'Create a new list.
Dim list As New PdfOrderedList()
'Set indent.
list.Indent = 10
'Set text indent.
list.TextIndent = 10
'Set font.
list.Font = font
'Set brush.
list.Brush = New PdfSolidBrush(Color.Red)
'Set pen.
list.Pen = PdfPens.Green
'Set string format.
list.StringFormat = format
'Add items.
list.Items.Add("PDF")
list.Items.Add("XlsIO")
list.Items.Add("DocIO")
'Draw the PDF list to page.
list.Draw(graphics, 10, 10)
' Save and close the document.
document.Save("Output.pdf")
document.Close(True)
- See Also
Methods
CreateItems(string)
Creates an item collection.
protected static PdfListItemCollection CreateItems(string text)
Parameters
text
stringThe text.
Returns
- PdfListItemCollection
The item collection initialized properly.
- See Also
Draw(PdfGraphics, float, float)
Draws an list on the Graphics.
public override void Draw(PdfGraphics graphics, float x, float y)
Parameters
graphics
PdfGraphicsGraphics context where the list should be printed.
x
floatX co-ordinate of the list.
y
floatY co-ordinate of 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 a new list.
PdfOrderedList list = new PdfOrderedList();
//Set indent.
list.Indent = 10;
//Set text indent.
list.TextIndent = 10;
//Set font.
list.Font = font;
//Set brush.
list.Brush = new PdfSolidBrush(Color.Red);
//Set pen.
list.Pen = PdfPens.Green;
//Set string format.
list.StringFormat = format;
//Add items.
list.Items.Add("PDF");
list.Items.Add("XlsIO");
list.Items.Add("DocIO");
//Draw the PDF list to page.
list.Draw(graphics, 10,10);
// 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 = 10.0F
'Create a new list.
Dim list As New PdfOrderedList()
'Set indent.
list.Indent = 10
'Set text indent.
list.TextIndent = 10
'Set font.
list.Font = font
'Set brush.
list.Brush = New PdfSolidBrush(Color.Red)
'Set pen.
list.Pen = PdfPens.Green
'Set string format.
list.StringFormat = format
'Add items.
list.Items.Add("PDF")
list.Items.Add("XlsIO")
list.Items.Add("DocIO")
'Draw the PDF list to page.
list.Draw(graphics, 10, 10)
' Save and close the document.
document.Save("Output.pdf")
document.Close(True)
- See Also
DrawInternal(PdfGraphics)
Draws list on the Graphics.
protected override void DrawInternal(PdfGraphics graphics)
Parameters
graphics
PdfGraphicsPdf graphics.
- See Also
Layout(PdfLayoutParams)
Layouts list at page.
protected override PdfLayoutResult Layout(PdfLayoutParams param)
Parameters
param
PdfLayoutParamsPdf layout parameters.
Returns
- PdfLayoutResult
Returns layout results.
- See Also
Events
BeginItemLayout
Event that rises when item begin layout.
public event BeginItemLayoutEventHandler BeginItemLayout
Event Type
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();
//Begin item layout event.
list.BeginItemLayout += List_BeginItemLayout;
//End item layout event.
list.EndItemLayout += List_EndItemLayout;
//Set indent.
list.Indent = 10;
//Set text indent.
list.TextIndent = 10;
//Set font.
list.Font = font;
//Set brush.
list.Brush = new PdfSolidBrush(Color.Red);
//Set pen.
list.Pen = PdfPens.Green;
//Set string format.
list.StringFormat = format;
//Add items.
list.Items.Add("PDF");
list.Items.Add("XlsIO");
list.Items.Add("DocIO");
//Draw the PDF list to page.
list.Draw(page, 10,10);
// Save and close the document.
document.Save("Output.pdf");
document.Close(true);
private void List_EndItemLayout(object sender, EndItemLayoutEventArgs args)
{
//End item layout event.
}
private void List_BeginItemLayout(object sender, BeginItemLayoutEventArgs args)
{
args.Item.Text += "_BeiginItem";
}
'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 = 10.0F
'Create a new list.
Dim list As New PdfOrderedList()
'Begin item layout event.
AddHandler list.BeginItemLayout, AddressOf List_BeginItemLayout
'End item layout event.
AddHandler list.EndItemLayout, AddressOf List_EndItemLayout
'Set indent.
list.Indent = 10
'Set text indent.
list.TextIndent = 10
'Set font.
list.Font = font
'Set brush.
list.Brush = New PdfSolidBrush(Color.Red)
'Set pen.
list.Pen = PdfPens.Green
'Set string format.
list.StringFormat = format
'Add items.
list.Items.Add("PDF")
list.Items.Add("XlsIO")
list.Items.Add("DocIO")
'Draw the PDF list to page.
list.Draw(page, 10, 10)
' Save and close the document.
document.Save("Output.pdf")
document.Close(True)
Private Sub List_EndItemLayout(sender As Object, args As EndItemLayoutEventArgs)
'End item layout event.
End Sub
Private Sub List_BeginItemLayout(sender As Object, args As BeginItemLayoutEventArgs)
args.Item.Text += "_BeiginItem"
End Sub
- See Also
EndItemLayout
Event that rises when item end layout.
public event EndItemLayoutEventHandler EndItemLayout
Event Type
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();
//Begin item layout event.
list.BeginItemLayout += List_BeginItemLayout;
//End item layout event.
list.EndItemLayout += List_EndItemLayout;
//Set indent.
list.Indent = 10;
//Set text indent.
list.TextIndent = 10;
//Set font.
list.Font = font;
//Set brush.
list.Brush = new PdfSolidBrush(Color.Red);
//Set pen.
list.Pen = PdfPens.Green;
//Set string format.
list.StringFormat = format;
//Add items.
list.Items.Add("PDF");
list.Items.Add("XlsIO");
list.Items.Add("DocIO");
//Draw the PDF list to page.
list.Draw(page, 10,10);
// Save and close the document.
document.Save("Output.pdf");
document.Close(true);
private void List_EndItemLayout(object sender, EndItemLayoutEventArgs args)
{
//End item layout event.
}
private void List_BeginItemLayout(object sender, BeginItemLayoutEventArgs args)
{
args.Item.Text += "_BeiginItem";
}
'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 = 10.0F
'Create a new list.
Dim list As New PdfOrderedList()
'Begin item layout event.
AddHandler list.BeginItemLayout, AddressOf List_BeginItemLayout
'End item layout event.
AddHandler list.EndItemLayout, AddressOf List_EndItemLayout
'Set indent.
list.Indent = 10
'Set text indent.
list.TextIndent = 10
'Set font.
list.Font = font
'Set brush.
list.Brush = New PdfSolidBrush(Color.Red)
'Set pen.
list.Pen = PdfPens.Green
'Set string format.
list.StringFormat = format
'Add items.
list.Items.Add("PDF")
list.Items.Add("XlsIO")
list.Items.Add("DocIO")
'Draw the PDF list to page.
list.Draw(page, 10, 10)
' Save and close the document.
document.Save("Output.pdf")
document.Close(True)
Private Sub List_EndItemLayout(sender As Object, args As EndItemLayoutEventArgs)
'End item layout event.
End Sub
Private Sub List_BeginItemLayout(sender As Object, args As BeginItemLayoutEventArgs)
args.Item.Text += "_BeiginItem"
End Sub
- See Also