Table of Contents

Class PdfColumnCollection

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

Represents the collection of the columns.

public class PdfColumnCollection : PdfCollection, IEnumerable
Inheritance
PdfColumnCollection
Implements
Inherited Members

Examples

// Create a PDF document
PdfDocument document = new PdfDocument();
//Create a new page
PdfPage page = document.Pages.Add();
//create the PdfLightTable
PdfLightTable table = new PdfLightTable();
// Set the DataSourceType as Direct
table.DataSourceType = PdfLightTableDataSourceType.TableDirect;
// Get the columns collection
PdfColumnCollection tableColumns = table.Columns;
// Add Columns
tableColumns.Add(new PdfColumn("Roll Number"));
tableColumns.Add(new PdfColumn("Name"));
tableColumns.Add(new PdfColumn("Class"));
// Add Rows
table.Rows.Add(new object[] { "111", "Maxim", "III" });
// Draw the table
table.Draw(page, new PointF(0, 0));
//Save the document
document.Save("Output.pdf");
//Close the document
document.Close(true);
' Create a PDF document
Dim document As New PdfDocument()
'Create a new page
Dim page As PdfPage = document.Pages.Add()
'create the PdfLightTable
Dim table As New PdfLightTable()
' Set the DataSourceType as Direct
table.DataSourceType = PdfLightTableDataSourceType.TableDirect
' Get the columns collection
Dim tableColumns As PdfColumnCollection = table.Columns
' Add Columns
tableColumns.Add(New PdfColumn("Roll Number"))
tableColumns.Add(New PdfColumn("Name"))
tableColumns.Add(New PdfColumn("Class"))
' Add Rows
table.Rows.Add(New Object() { "111", "Maxim", "III" })
' Draw the table
table.Draw(page, New PointF(0, 0))
'Save the document
document.Save("Output.pdf")
'Close the document
document.Close(True)

Properties

this[int]

Gets the PdfColumn at the specified index.Read-Only.

public PdfColumn this[int index] { get; }

Parameters

index int

Property Value

PdfColumn

Examples

// Create a PDF document
PdfDocument document = new PdfDocument();
//Create a new page
PdfPage page = document.Pages.Add();
//create the PdfLightTable
PdfLightTable table = new PdfLightTable();
// Set the DataSourceType as Direct
table.DataSourceType = PdfLightTableDataSourceType.TableDirect;
// Get the columns collection
PdfColumnCollection tableColumns = table.Columns;
// Add Columns
tableColumns.Add(new PdfColumn("Roll Number"));
tableColumns.Add(new PdfColumn("Name"));
tableColumns.Add(new PdfColumn("Class"));
//Get the table colum by index.
PdfColumn column = tableColumns[0];
// Add Rows
table.Rows.Add(new object[] { "111", "Maxim", "III" });
// Draw the table
table.Draw(page, new PointF(0, 0));
//Save the document
document.Save("Output.pdf");
//Close the document
document.Close(true);
' Create a PDF document
Dim document As New PdfDocument()
'Create a new page
Dim page As PdfPage = document.Pages.Add()
'create the PdfLightTable
Dim table As New PdfLightTable()
' Set the DataSourceType as Direct
table.DataSourceType = PdfLightTableDataSourceType.TableDirect
' Get the columns collection
Dim tableColumns As PdfColumnCollection = table.Columns
' Add Columns
tableColumns.Add(New PdfColumn("Roll Number"))
tableColumns.Add(New PdfColumn("Name"))
tableColumns.Add(New PdfColumn("Class"))
'Get the table colum by index.
Dim column As PdfColumn = tableColumns(0)
' Add Rows
table.Rows.Add(New Object() { "111", "Maxim", "III" })
' Draw the table
table.Draw(page, New PointF(0, 0))
'Save the document
document.Save("Output.pdf")
'Close the document
document.Close(True)
See Also

Methods

Add(PdfColumn)

Add the specified PdfColumn in specified PdfColumnCollection

public void Add(PdfColumn column)

Parameters

column PdfColumn

The PdfColumn.

Examples

// Create a PDF document
PdfDocument document = new PdfDocument();
//Create a new page
PdfPage page = document.Pages.Add();
//create the PdfLightTable
PdfLightTable table = new PdfLightTable();
// Set the DataSourceType as Direct
table.DataSourceType = PdfLightTableDataSourceType.TableDirect;
// Get the columns collection
PdfColumnCollection tableColumns = table.Columns;
// Add Columns
tableColumns.Add(new PdfColumn("Roll Number"));
tableColumns.Add(new PdfColumn("Name"));
tableColumns.Add(new PdfColumn("Class"));
// Add Rows
table.Rows.Add(new object[] { "111", "Maxim", "III" });
// Draw the table
table.Draw(page, new PointF(0, 0));
//Save the document
document.Save("Output.pdf");
//Close the document
document.Close(true);
' Create a PDF document
Dim document As New PdfDocument()
'Create a new page
Dim page As PdfPage = document.Pages.Add()
'create the PdfLightTable
Dim table As New PdfLightTable()
' Set the DataSourceType as Direct
table.DataSourceType = PdfLightTableDataSourceType.TableDirect
' Get the columns collection
Dim tableColumns As PdfColumnCollection = table.Columns
' Add Columns
tableColumns.Add(New PdfColumn("Roll Number"))
tableColumns.Add(New PdfColumn("Name"))
tableColumns.Add(New PdfColumn("Class"))
' Add Rows
table.Rows.Add(New Object() { "111", "Maxim", "III" })
' Draw the table
table.Draw(page, New PointF(0, 0))
'Save the document
document.Save("Output.pdf")
'Close the document
document.Close(True)
See Also

See Also