menu

Document Processing

PdfGridLayoutResult Class - C# PDF Library API Reference | Syncfusion

    Show / Hide Table of Contents

    PdfGridLayoutResult Class

    Represents the results of the PdfGrid including bounds and resultant page.

    Inheritance
    System.Object
    PdfLayoutResult
    PdfGridLayoutResult
    Inherited Members
    PdfLayoutResult.Bounds
    PdfLayoutResult.Page
    Namespace: Syncfusion.Pdf.Grid
    Assembly: Syncfusion.Pdf.Base.dll
    Syntax
    public class PdfGridLayoutResult : PdfLayoutResult
    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;
    //Draw grid to the page of PDF document.
    PdfGridLayoutResult result = pdfGrid.Draw(page, new PointF(10, 10));
    //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
    'Draw grid to the page of PDF document.
    Dim result As PdfGridLayoutResult = pdfGrid.Draw(page, New PointF(10, 10))
    'Save the document.
    doc.Save("Output.pdf")
    'close the document
    doc.Close(True)

    Constructors

    PdfGridLayoutResult(PdfPage, RectangleF)

    Initializes a new instance of the PdfGridLayoutResult class with the current page and bounds.

    Declaration
    public PdfGridLayoutResult(PdfPage page, RectangleF bounds)
    Parameters
    Type Name Description
    PdfPage page

    The current page.

    System.Drawing.RectangleF bounds

    The current bounds.

    Remarks

    The page might be null, which means that lay outing was performed on PdfGraphics.

    Back to top Generated by DocFX
    Copyright © 2001 - 2025 Syncfusion Inc. All Rights Reserved