Class BeginItemLayoutEventArgs
Represents begin layout event arguments.
Inheritance
System.Object
BeginItemLayoutEventArgs
Inherited Members
System.Object.ToString()
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
Namespace: Syncfusion.Pdf.Lists
Assembly: Syncfusion.Pdf.Base.dll
Syntax
public class BeginItemLayoutEventArgs
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
Properties
Item
Gets the item.
Declaration
public PdfListItem Item { get; }
Property Value
Type | Description |
---|---|
PdfListItem | The item that layout. |
Page
Gets the page.
Declaration
public PdfPage Page { get; }
Property Value
Type | Description |
---|---|
PdfPage | The page in which item start layout. |