Class BeginItemLayoutEventHandler
Delegate for handling BeginItemLayoutEvent.
Inheritance
System.Object
BeginItemLayoutEventHandler
Assembly: Syncfusion.Pdf.NET.dll
Syntax
public sealed class BeginItemLayoutEventHandler : MulticastDelegate
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
Constructors
BeginItemLayoutEventHandler(Object, IntPtr)
Declaration
public BeginItemLayoutEventHandler(object object, IntPtr method)
Parameters
Type |
Name |
Description |
System.Object |
object |
|
System.IntPtr |
method |
|
Methods
BeginInvoke(Object, BeginItemLayoutEventArgs, AsyncCallback, Object)
Declaration
public virtual IAsyncResult BeginInvoke(object sender, BeginItemLayoutEventArgs args, AsyncCallback callback, object object)
Parameters
Type |
Name |
Description |
System.Object |
sender |
|
BeginItemLayoutEventArgs |
args |
|
System.AsyncCallback |
callback |
|
System.Object |
object |
|
Returns
EndInvoke(IAsyncResult)
Declaration
public virtual void EndInvoke(IAsyncResult result)
Parameters
Type |
Name |
Description |
System.IAsyncResult |
result |
|
Invoke(Object, BeginItemLayoutEventArgs)
Declaration
public virtual void Invoke(object sender, BeginItemLayoutEventArgs args)
Parameters