menu

Document Processing

PdfLightTableLayoutResult Class - C# PDF Library API Reference | Syncfusion

    Show / Hide Table of Contents

    PdfLightTableLayoutResult Class

    Represents the result of PdfLightTable which contains bounds and resultant page.

    Inheritance
    System.Object
    PdfLayoutResult
    PdfLightTableLayoutResult
    Inherited Members
    PdfLayoutResult.Bounds
    PdfLayoutResult.Page
    Namespace: Syncfusion.Pdf.Tables
    Assembly: Syncfusion.Pdf.Base.dll
    Syntax
    public class PdfLightTableLayoutResult : PdfLayoutResult
    Examples
    // Create a new document
    PdfDocument doc = new PdfDocument();
    //Create a new page
    PdfPage page = doc.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();
    format.Layout = PdfLayoutType.Paginate;
    format.Break = PdfLayoutBreakType.FitElement;
    // Draw the table
    PdfLightTableLayoutResult result = table.Draw(page, new PointF(0, 0), format);
    //Save the document.
    doc.Save("Output.pdf");
    //Close the document
    doc.Close(true);
    ' Create a new document
    Dim doc As New PdfDocument()
    'Create a new page
    Dim page As PdfPage = doc.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()
    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.
    doc.Save("Output.pdf")
    'Close the document
    doc.Close(True)

    Properties

    LastRowIndex

    Gets the index of the last row. Read-Only.

    Declaration
    public int LastRowIndex { get; }
    Property Value
    Type
    System.Int32
    Examples
    // Create a new document
    PdfDocument doc = new PdfDocument();
    //Create a new page
    PdfPage page = doc.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();
    format.Layout = PdfLayoutType.Paginate;
    format.Break = PdfLayoutBreakType.FitElement;
    // Draw the table
    PdfLightTableLayoutResult result = table.Draw(page, new PointF(0, 0), format);
    // Gets the last row index
    int lastRow = result.LastRowIndex;
    //Save the document.
    doc.Save("Output.pdf");
    //Close the document
    doc.Close(true);
    ' Create a new document
    Dim doc As New PdfDocument()
    'Create a new page
    Dim page As PdfPage = doc.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()
    format.Layout = PdfLayoutType.Paginate
    format.Break = PdfLayoutBreakType.FitElement
    ' Draw the table
    Dim result As PdfLightTableLayoutResult = table.Draw(page, New PointF(0, 0), format)
    ' Gets the last row index
    Dim lastRow As Integer = result.LastRowIndex
    'Save the document.
    doc.Save("Output.pdf")
    'Close the document
    doc.Close(True)

    See Also

    PdfLayoutResult
    In This Article
    • Properties
      • LastRowIndex
    • See Also
    Was this page helpful? Yes No
    Thank you for your feedback!
    Thank you for your feedback and comments. We will rectify this as soon as possible!
    An unknown error has occurred. Please try again.
    SEND FEEDBACK REGARDING THIS TOPIC

    Please provide additional information

    Please provide additional information

    Please provide additional information

    Please provide additional information
    Please provide additional information
    Copyright © 2001 - 2025 Syncfusion Inc. All Rights Reserved