menu

WPF

  • Code Examples
  • Upgrade Guide
  • User Guide
  • Demos
  • Support
  • Forums
  • Download
Enum PdfHorizontalOverflowType - WPF API Reference | Syncfusion

    Show / Hide Table of Contents

    Enum PdfHorizontalOverflowType

    Describe the possible values of PdfHorizontalOverflowType. If a grid is drawn which doesn't fits within a single page, it will be splited to several pages.

    Namespace: Syncfusion.Pdf.Grid
    Assembly: Syncfusion.Pdf.Base.dll
    Syntax
    public enum PdfHorizontalOverflowType
    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;
    //Using the Column collection
    pdfGrid.Columns[0].Width = 100;
    //Adding grid style
    PdfGridStyle gridStyle = new PdfGridStyle();
    //Allow grid to overflow horizontally
    gridStyle.AllowHorizontalOverflow = true;
    //Set cell padding
    gridStyle.CellPadding = new PdfPaddings(5,5,5,5);
    //Adding cell spacing between cells
    gridStyle.CellSpacing = 0.5F;
    //Set border ovelay style.
    gridStyle.BorderOverlapStyle = PdfBorderOverlapStyle.Inside;
    //Set horizontal overflow type.
    gridStyle.HorizontalOverflowType = PdfHorizontalOverflowType.LastPage;
    //Applying style to grid
    pdfGrid.Style = gridStyle;
    //Draw grid to the page of PDF document.
    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
    'Using the Column collection
    pdfGrid.Columns(0).Width = 100
    'Adding grid style
    Dim gridStyle As New PdfGridStyle()
    'Allow grid to overflow horizontally
    gridStyle.AllowHorizontalOverflow = True
    'Set cell padding
    gridStyle.CellPadding = New PdfPaddings(5,5,5,5)
    'Adding cell spacing between cells
    gridStyle.CellSpacing = 0.5F
    'Set border ovelay style.
    gridStyle.BorderOverlapStyle = PdfBorderOverlapStyle.Inside
    'Set horizontal overflow type.
    gridStyle.HorizontalOverflowType = PdfHorizontalOverflowType.LastPage
    'Applying style to grid
    pdfGrid.Style = gridStyle
    'Draw grid to the page of PDF document.
    pdfGrid.Draw(page, New PointF(10, 10))
    'Save the document.
    doc.Save("Output.pdf")
    'close the document
    doc.Close(True)

    Fields

    Name Description
    LastPage

    Draws the overflowing grid as last page

    NextPage

    Draws the overflowing grid as next page

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