Class ListBeginPageLayoutEventArgs
Represents begin page layout event arguments.
Inheritance
System.Object
System.EventArgs
ListBeginPageLayoutEventArgs
Inherited Members
System.EventArgs.Empty
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 ListBeginPageLayoutEventArgs : BeginPageLayoutEventArgs
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;
string[] products = { "Tools", "Grid", "Chart", "Edit", "Diagram", "XlsIO", "Grouping", "Calculate", "PDF", "HTMLUI", "DocIO" };
// Creates an item collection
PdfListItemCollection listItemCollection = new PdfListItemCollection(products);
//Create a unordered list
PdfUnorderedList list = new PdfUnorderedList(listItemCollection);
//Set the marker style
list.Marker.Style = PdfUnorderedMarkerStyle.Disk;
// Event handler
list.BeginPageLayout += new BeginPageLayoutEventHandler(list_BeginPageLayout);
list.Draw(page, new RectangleF(0, 130, page.Graphics.ClientSize.Width, page.Graphics.ClientSize.Height));
document.Save("List.pdf");
// Event handler
void list_BeginPageLayout(object sender, BeginPageLayoutEventArgs e)
{
// Set the new bounds for the list
e.Bounds = new RectangleF(0, 0, e.Page.GetClientSize().Width, e.Page.GetClientSize().Height);
}
'Create a new PDf document
Private document As PdfDocument = New PdfDocument()
'Create a page
Private page As PdfPage = document.Pages.Add()
Private graphics As PdfGraphics = page.Graphics
Private products() As String = { "Tools", "Grid", "Chart", "Edit", "Diagram", "XlsIO", "Grouping", "Calculate", "PDF", "HTMLUI", "DocIO" }
' Creates an item collection
Private listItemCollection As PdfListItemCollection = New PdfListItemCollection(products)
'Create a unordered list
Private list As PdfUnorderedList = New PdfUnorderedList(listItemCollection)
'Set the marker style
list.Marker.Style = PdfUnorderedMarkerStyle.Disk
' Event handler
AddHandler list.BeginPageLayout, AddressOf list_BeginPageLayout
list.Draw(page, New RectangleF(0, 130, page.Graphics.ClientSize.Width, page.Graphics.ClientSize.Height))
document.Save("List.pdf")
' Event handler
Private Sub list_BeginPageLayout(ByVal sender As Object, ByVal e As BeginPageLayoutEventArgs)
' Set the new bounds for the list
e.Bounds = New RectangleF(0, 0, e.Page.GetClientSize().Width, e.Page.GetClientSize().Height)
End Sub
Properties
List
Gets the list that starts layout.
Declaration
public PdfList List { get; }
Property Value
Type | Description |
---|---|
PdfList | The list that starts layout. |
Examples
// Event handler
void list_BeginPageLayout(object sender, BeginPageLayoutEventArgs e)
{
PdfUnorderedList list = sender as PdfUnorderedList;
list.Font = new PdfStandardFont(PdfFontFamily.Helvetica, 12);
// Set the new bounds for the list
e.Bounds = new RectangleF(0, 0, e.Page.GetClientSize().Width, e.Page.GetClientSize().Height);
}
' Event handler
Private Sub list_BeginPageLayout(ByVal sender As Object, ByVal e As BeginPageLayoutEventArgs)
Dim list As PdfUnorderedList = TryCast(sender, PdfUnorderedList)
list.Font = New PdfStandardFont(PdfFontFamily.Helvetica, 12)
' Set the new bounds for the list
e.Bounds = New RectangleF(0, 0, e.Page.GetClientSize().Width, e.Page.GetClientSize().Height)
End Sub