Table of Contents

Class PdfLightTableLayoutFormat

Namespace
Syncfusion.Pdf.Tables
Assembly
Syncfusion.Pdf.Portable.dll

Represents the parameters for PdfLightTable layout.

public class PdfLightTableLayoutFormat : PdfLayoutFormat
Inheritance
PdfLightTableLayoutFormat
Inherited Members

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.

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.

public PdfLightTableLayoutFormat(PdfLayoutFormat baseFormat)

Parameters

baseFormat PdfLayoutFormat

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)
See Also

Properties

EndColumnIndex

Gets or sets the end column index.

public int EndColumnIndex { get; set; }

Property Value

int

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.

public int StartColumnIndex { get; set; }

Property Value

int

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

See Also