Class PdfList
Represents base class for lists.
Inheritance
System.Object
PdfList
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 abstract class PdfList : PdfLayoutElement
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.
Declaration
protected static readonly char[] c_splitChars
Field Value
Type | Description |
---|---|
System.Char[] |
Properties
Brush
Gets or sets list brush.
Declaration
public PdfBrush Brush { get; set; }
Property Value
Type | Description |
---|---|
PdfBrush |
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)
Font
Gets or sets the list font.
Declaration
public PdfFont Font { get; set; }
Property Value
Type | Description |
---|---|
PdfFont |
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)
Indent
Gets or sets tabulation for the list.
Declaration
public float Indent { get; set; }
Property Value
Type | Description |
---|---|
System.Single |
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)
Items
Gets items of the list.
Declaration
public PdfListItemCollection Items { get; }
Property Value
Type | Description |
---|---|
PdfListItemCollection |
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)
Pen
Gets or sets list pen.
Declaration
public PdfPen Pen { get; set; }
Property Value
Type | Description |
---|---|
PdfPen |
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)
StringFormat
Gets or sets the format of the list.
Declaration
public PdfStringFormat StringFormat { get; set; }
Property Value
Type | Description |
---|---|
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)
TextIndent
Gets or sets the indent from the marker to the list item text.
Declaration
public float TextIndent { get; set; }
Property Value
Type | Description |
---|---|
System.Single |
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)
Methods
Draw(PdfGraphics, Single, Single)
Draws an list on the Graphics.
Declaration
public override void Draw(PdfGraphics graphics, float x, float y)
Parameters
Type | Name | Description |
---|---|---|
PdfGraphics | graphics | Graphics context where the list should be printed. |
System.Single | x | X co-ordinate of the list. |
System.Single | y | Y co-ordinate of the list. |
Overrides
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)
Layout(PdfLayoutParams)
Layouts list at page.
Declaration
protected override PdfLayoutResult Layout(PdfLayoutParams param)
Parameters
Type | Name | Description |
---|---|---|
PdfLayoutParams | param | Pdf layout parameters. |
Returns
Type | Description |
---|---|
PdfLayoutResult | Returns layout results. |
Overrides
Events
BeginItemLayout
Event that rises when item begin layout.
Declaration
public event BeginItemLayoutEventHandler BeginItemLayout
Event Type
Type | Description |
---|---|
BeginItemLayoutEventHandler |
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
EndItemLayout
Event that rises when item end layout.
Declaration
public event EndItemLayoutEventHandler EndItemLayout
Event Type
Type | Description |
---|---|
EndItemLayoutEventHandler |
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