Class PdfGridLayoutFormat
Provides parameters definition for PdfGrid layout.
Inherited Members
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Namespace: Syncfusion.Pdf.Grid
Assembly: Syncfusion.Pdf.Base.dll
Syntax
public class PdfGridLayoutFormat : PdfLayoutFormat
Examples
//Create a new PDF document.
PdfDocument doc = new PdfDocument();
//Add a page.
PdfPage page = doc.Pages.Add();
//Create a PdfGrid.
PdfGrid pdfGrid = new PdfGrid();
//Create a DataTable.
DataTable dataTable = new DataTable();
//Add columns to the DataTable
dataTable.Columns.Add("ID");
dataTable.Columns.Add("Name");
//Add rows to the DataTable.
dataTable.Rows.Add(new object[] { "E01", "Clay" });
dataTable.Rows.Add(new object[] { "E02", "Thomas" });
//Assign data source.
pdfGrid.DataSource = dataTable;
//Layout format
PdfGridLayoutFormat format = new PdfGridLayoutFormat();
format.Break = PdfLayoutBreakType.FitPage;
format.PaginateBounds = new RectangleF(0, 0, 400, 500);
//Draw grid to the page of PDF document.
pdfGrid.Draw(page, new PointF(10, 10),format);
//Save the document.
doc.Save("Output.pdf");
//close the document
doc.Close(true);
'Create a new PDF document.
Dim doc As New PdfDocument()
'Add a page.
Dim page As PdfPage = doc.Pages.Add()
'Create a PdfGrid.
Dim pdfGrid As New PdfGrid()
'Create a DataTable.
Dim dataTable As New DataTable()
'Add columns to the DataTable
dataTable.Columns.Add("ID")
dataTable.Columns.Add("Name")
'Add rows to the DataTable.
dataTable.Rows.Add(New Object() {"E01", "Clay"})
dataTable.Rows.Add(New Object() {"E02", "Thomas"})
'Assign data source.
pdfGrid.DataSource = dataTable
'Layout format
Dim format As New PdfGridLayoutFormat()
format.Break = PdfLayoutBreakType.FitPage
format.PaginateBounds = New RectangleF(0, 0, 400, 500)
'Draw grid to the page of PDF document.
pdfGrid.Draw(page, New PointF(10, 10),format)
'Save the document.
doc.Save("Output.pdf")
'close the document
doc.Close(True)
Constructors
PdfGridLayoutFormat()
Initializes a new instance of the PdfGridLayoutFormat class.
Declaration
public PdfGridLayoutFormat()
Examples
//Create a new PDF document.
PdfDocument doc = new PdfDocument();
//Add a page.
PdfPage page = doc.Pages.Add();
//Create a PdfGrid.
PdfGrid pdfGrid = new PdfGrid();
//Create a DataTable.
DataTable dataTable = new DataTable();
//Add columns to the DataTable
dataTable.Columns.Add("ID");
dataTable.Columns.Add("Name");
//Add rows to the DataTable.
dataTable.Rows.Add(new object[] { "E01", "Clay" });
dataTable.Rows.Add(new object[] { "E02", "Thomas" });
//Assign data source.
pdfGrid.DataSource = dataTable;
//Layout format
PdfGridLayoutFormat format = new PdfGridLayoutFormat();
format.Break = PdfLayoutBreakType.FitPage;
format.PaginateBounds = new RectangleF(0, 0, 400, 500);
//Draw grid to the page of PDF document.
pdfGrid.Draw(page, new PointF(10, 10),format);
//Save the document.
doc.Save("Output.pdf");
//close the document
doc.Close(true);
'Create a new PDF document.
Dim doc As New PdfDocument()
'Add a page.
Dim page As PdfPage = doc.Pages.Add()
'Create a PdfGrid.
Dim pdfGrid As New PdfGrid()
'Create a DataTable.
Dim dataTable As New DataTable()
'Add columns to the DataTable
dataTable.Columns.Add("ID")
dataTable.Columns.Add("Name")
'Add rows to the DataTable.
dataTable.Rows.Add(New Object() {"E01", "Clay"})
dataTable.Rows.Add(New Object() {"E02", "Thomas"})
'Assign data source.
pdfGrid.DataSource = dataTable
'Layout format
Dim format As New PdfGridLayoutFormat()
format.Break = PdfLayoutBreakType.FitPage
format.PaginateBounds = New RectangleF(0, 0, 400, 500)
'Draw grid to the page of PDF document.
pdfGrid.Draw(page, New PointF(10, 10),format)
'Save the document.
doc.Save("Output.pdf")
'close the document
doc.Close(True)
PdfGridLayoutFormat(PdfLayoutFormat)
Initializes a new instance of the PdfGridLayoutFormat class with a base format.
Declaration
public PdfGridLayoutFormat(PdfLayoutFormat baseFormat)
Parameters
Type | Name | Description |
---|---|---|
PdfLayoutFormat | baseFormat | The base format. |