Class PdfLightTableLayoutFormat
Represents the parameters for PdfLightTable layout.
Namespace: Syncfusion.Pdf.Tables
Assembly: Syncfusion.Pdf.Portable.dll
Syntax
public class PdfLightTableLayoutFormat : PdfLayoutFormat
Examples
// Creates a new document
PdfDocument document = new PdfDocument();
//Creates a new page and adds it as the last page of the document
PdfPage page = document.Pages.Add();
// Creates a new table
PdfLightTable table = new PdfLightTable();
// Set the DataSourceType as Direct
table.DataSourceType = PdfLightTableDataSourceType.TableDirect;
// Creating Columns
table.Columns.Add(new PdfColumn("Roll Number"));
table.Columns.Add(new PdfColumn("Name"));
table.Columns.Add(new PdfColumn("Class"));
// Adding rows
PdfRowCollection rowCollection = table.Rows;
// Gets the first row from the collection.
rowCollection.Add(new object[] { "111", "Maxim", "III" });
// Creates the layout format
PdfLightTableLayoutFormat format = new PdfLightTableLayoutFormat();
format.Layout = PdfLayoutType.Paginate;
format.Break = PdfLayoutBreakType.FitElement;
format.StartColumnIndex = 1;
format.EndColumnIndex = 2;
// Draws the table with the layout format
table.Draw(page, new PointF(0, 0), format);
document.Save("Tables.pdf");
' Creates a new document
Dim document As PdfDocument = New PdfDocument()
' Create a page
Dim page As PdfPage = document.Pages.Add()
' Creates a new table
Dim table As PdfLightTable = New PdfLightTable()
' Set the DataSourceType as Direct
table.DataSourceType = PdfLightTableDataSourceType.TableDirect
' Creating Columns
table.Columns.Add(New PdfColumn("Roll Number"))
table.Columns.Add(New PdfColumn("Name"))
table.Columns.Add(New PdfColumn("Class"))
' Adding rows
Dim rowCollection As PdfRowCollection = table.Rows
' Gets the first row from the collection.
rowCollection.Add(New Object() { "111", "Maxim", "III" })
' Creates the layout format
Dim format As PdfLightTableLayoutFormat = New PdfLightTableLayoutFormat()
format.Layout = PdfLayoutType.Paginate
format.Break = PdfLayoutBreakType.FitElement
format.StartColumnIndex = 1
format.EndColumnIndex = 2
' Draws the table with the layout format
table.Draw(page, New PointF(0, 0), format)
document.Save("Tables.pdf")
Constructors
PdfLightTableLayoutFormat()
Initializes a new instance of the PdfLightTableLayoutFormat class.
Declaration
public PdfLightTableLayoutFormat()
Examples
// Create a new document
PdfDocument document = new PdfDocument();
//Create a new page
PdfPage page = document.Pages.Add();
// Create a new table
PdfLightTable table = new PdfLightTable();
// Set the DataSourceType as Direct
table.DataSourceType = PdfLightTableDataSourceType.TableDirect;
// Creating Columns
table.Columns.Add(new PdfColumn("Roll Number"));
table.Columns.Add(new PdfColumn("Name"));
table.Columns.Add(new PdfColumn("Class"));
// Adding rows
PdfRowCollection rowCollection = table.Rows;
// Gets the first row from the collection.
rowCollection.Add(new object[] { "111", "Maxim", "III" });
// Create the layout format
PdfLightTableLayoutFormat format = new PdfLightTableLayoutFormat();
//set the column index
format.StartColumnIndex = 1;
format.EndColumnIndex = 2;
format.Layout = PdfLayoutType.Paginate;
format.Break = PdfLayoutBreakType.FitElement;
// Draw the table
PdfLightTableLayoutResult result = table.Draw(page, new PointF(0, 0), format);
//Save the document.
document.Save("Output.pdf");
//Close the document
document.Close(true);
' Create a new document
Dim document As New PdfDocument()
'Create a new page
Dim page As PdfPage = document.Pages.Add()
' Create a new table
Dim table As New PdfLightTable()
' Set the DataSourceType as Direct
table.DataSourceType = PdfLightTableDataSourceType.TableDirect
' Creating Columns
table.Columns.Add(New PdfColumn("Roll Number"))
table.Columns.Add(New PdfColumn("Name"))
table.Columns.Add(New PdfColumn("Class"))
' Adding rows
Dim rowCollection As PdfRowCollection = table.Rows
' Gets the first row from the collection.
rowCollection.Add(New Object() { "111", "Maxim", "III" })
' Create the layout format
Dim format As New PdfLightTableLayoutFormat()
'set the column index
format.EndColumnIndex = 2
format.StartColumnIndex = 1
format.Layout = PdfLayoutType.Paginate
format.Break = PdfLayoutBreakType.FitElement
' Draw the table
Dim result As PdfLightTableLayoutResult = table.Draw(page, New PointF(0, 0), format
'Save the document.
document.Save("Output.pdf")
'Close the document
document.Close(True)
See Also
PdfLightTableLayoutFormat(PdfLayoutFormat)
Initializes a new instance of the PdfLightTableLayoutFormat class with specified layout format.
Declaration
public PdfLightTableLayoutFormat(PdfLayoutFormat baseFormat)
Parameters
Type | Name | Description |
---|---|---|
PdfLayoutFormat | baseFormat | The layout format. |
Examples
// Create a new document
PdfDocument document = new PdfDocument();
//Create a new page
PdfPage page = document.Pages.Add();
// Create a new table
PdfLightTable table = new PdfLightTable();
// Set the DataSourceType as Direct
table.DataSourceType = PdfLightTableDataSourceType.TableDirect;
// Creating Columns
table.Columns.Add(new PdfColumn("Roll Number"));
table.Columns.Add(new PdfColumn("Name"));
table.Columns.Add(new PdfColumn("Class"));
// Adding rows
PdfRowCollection rowCollection = table.Rows;
// Gets the first row from the collection.
rowCollection.Add(new object[] { "111", "Maxim", "III" });
PdfLayoutFormat lformat = new PdfLayoutFormat();
lformat.Break = PdfLayoutBreakType.FitPage;
lformat.Layout = PdfLayoutType.Paginate;
lformat.PaginateBounds = new RectangleF(0, 0, 500, 700);
// Create the layout format
PdfLightTableLayoutFormat format = new PdfLightTableLayoutFormat(lformat);
//set the column index
format.StartColumnIndex = 1;
format.EndColumnIndex = 2;
// Draw the table
PdfLightTableLayoutResult result = table.Draw(page, new PointF(0, 0), format);
//Save the document.
document.Save("Output.pdf");
//Close the document
document.Close(true);
' Create a new document
Dim document As New PdfDocument()
'Create a new page
Dim page As PdfPage = document.Pages.Add()
' Create a new table
Dim table As New PdfLightTable()
' Set the DataSourceType as Direct
table.DataSourceType = PdfLightTableDataSourceType.TableDirect
' Creating Columns
table.Columns.Add(New PdfColumn("Roll Number"))
table.Columns.Add(New PdfColumn("Name"))
table.Columns.Add(New PdfColumn("Class"))
' Adding rows
Dim rowCollection As PdfRowCollection = table.Rows
' Gets the first row from the collection.
rowCollection.Add(New Object() { "111", "Maxim", "III" })
Dim lformat As PdfLayoutFormat = New PdfLayoutFormat();
lformat.Break = PdfLayoutBreakType.FitPage;
lformat.Layout = PdfLayoutType.Paginate;
lformat.PaginateBounds = new RectangleF(0, 0, 500, 700);
' Create the layout format
Dim format As New PdfLightTableLayoutFormat(lformat)
'set the column index
format.EndColumnIndex = 2
format.StartColumnIndex = 1
' Draw the table
Dim result As PdfLightTableLayoutResult = table.Draw(page, New PointF(0, 0), format
'Save the document.
document.Save("Output.pdf")
'Close the document
document.Close(True)
Properties
EndColumnIndex
Gets or sets the end column index.
Declaration
public int EndColumnIndex { get; set; }
Property Value
Type |
---|
System.Int32 |
Examples
// Create a new document
PdfDocument document = new PdfDocument();
//Create a new page
PdfPage page = document.Pages.Add();
// Create a new table
PdfLightTable table = new PdfLightTable();
// Set the DataSourceType as Direct
table.DataSourceType = PdfLightTableDataSourceType.TableDirect;
// Creating Columns
table.Columns.Add(new PdfColumn("Roll Number"));
table.Columns.Add(new PdfColumn("Name"));
table.Columns.Add(new PdfColumn("Class"));
// Adding rows
PdfRowCollection rowCollection = table.Rows;
// Gets the first row from the collection.
rowCollection.Add(new object[] { "111", "Maxim", "III" });
// Create the layout format
PdfLightTableLayoutFormat format = new PdfLightTableLayoutFormat();
//set the column index
format.StartColumnIndex = 1;
format.EndColumnIndex = 2;
format.Layout = PdfLayoutType.Paginate;
format.Break = PdfLayoutBreakType.FitElement;
// Draw the table
PdfLightTableLayoutResult result = table.Draw(page, new PointF(0, 0), format);
//Save the document.
document.Save("Output.pdf");
//Close the document
document.Close(true);
' Create a new document
Dim document As New PdfDocument()
'Create a new page
Dim page As PdfPage = document.Pages.Add()
' Create a new table
Dim table As New PdfLightTable()
' Set the DataSourceType as Direct
table.DataSourceType = PdfLightTableDataSourceType.TableDirect
' Creating Columns
table.Columns.Add(New PdfColumn("Roll Number"))
table.Columns.Add(New PdfColumn("Name"))
table.Columns.Add(New PdfColumn("Class"))
' Adding rows
Dim rowCollection As PdfRowCollection = table.Rows
' Gets the first row from the collection.
rowCollection.Add(New Object() { "111", "Maxim", "III" })
' Create the layout format
Dim format As New PdfLightTableLayoutFormat()
'set the column index
format.EndColumnIndex = 2
format.StartColumnIndex = 1
format.Layout = PdfLayoutType.Paginate
format.Break = PdfLayoutBreakType.FitElement
' Draw the table
Dim result As PdfLightTableLayoutResult = table.Draw(page, New PointF(0, 0), format
'Save the document.
document.Save("Output.pdf")
'Close the document
document.Close(True)
See Also
StartColumnIndex
Gets or sets the start column index.
Declaration
public int StartColumnIndex { get; set; }
Property Value
Type |
---|
System.Int32 |
Examples
// Create a new document
PdfDocument document = new PdfDocument();
//Create a new page
PdfPage page = document.Pages.Add();
// Create a new table
PdfLightTable table = new PdfLightTable();
// Set the DataSourceType as Direct
table.DataSourceType = PdfLightTableDataSourceType.TableDirect;
// Creating Columns
table.Columns.Add(new PdfColumn("Roll Number"));
table.Columns.Add(new PdfColumn("Name"));
table.Columns.Add(new PdfColumn("Class"));
// Adding rows
PdfRowCollection rowCollection = table.Rows;
// Gets the first row from the collection.
rowCollection.Add(new object[] { "111", "Maxim", "III" });
// Create the layout format
PdfLightTableLayoutFormat format = new PdfLightTableLayoutFormat();
//set the column index
format.StartColumnIndex = 1;
format.EndColumnIndex = 2;
format.Layout = PdfLayoutType.Paginate;
format.Break = PdfLayoutBreakType.FitElement;
// Draw the table
PdfLightTableLayoutResult result = table.Draw(page, new PointF(0, 0), format);
//Save the document.
document.Save("Output.pdf");
//Close the document
document.Close(true);
' Create a new document
Dim document As New PdfDocument()
'Create a new page
Dim page As PdfPage = document.Pages.Add()
' Create a new table
Dim table As New PdfLightTable()
' Set the DataSourceType as Direct
table.DataSourceType = PdfLightTableDataSourceType.TableDirect
' Creating Columns
table.Columns.Add(New PdfColumn("Roll Number"))
table.Columns.Add(New PdfColumn("Name"))
table.Columns.Add(New PdfColumn("Class"))
' Adding rows
Dim rowCollection As PdfRowCollection = table.Rows
' Gets the first row from the collection.
rowCollection.Add(New Object() { "111", "Maxim", "III" })
' Create the layout format
Dim format As New PdfLightTableLayoutFormat()
'set the column index
format.EndColumnIndex = 2
format.StartColumnIndex = 1
format.Layout = PdfLayoutType.Paginate
format.Break = PdfLayoutBreakType.FitElement
' Draw the table
Dim result As PdfLightTableLayoutResult = table.Draw(page, New PointF(0, 0), format
'Save the document.
document.Save("Output.pdf")
'Close the document
document.Close(True)