Skip to main content

LayoutGrid

Version: 7.0

cete.dynamicpdf.pageelements.layoutgrid

LayoutGrid​

Represents a layout grid.

public class LayoutGrid : PageElement, ISerializable
Public Class LayoutGrid
Inherits PageElement
Implements ISerializable

Inheritance: Object → PageElement → LayoutGrid

Implements: ISerializable

Licensing​

This class is a DynamicPDF Generator Community Edition feature.

Examples​

The following example will place a layout grid on the page and also places a rectangle on the page for reference.

Imports System
Imports ceTe.DynamicPDF
Imports ceTe.DynamicPDF.PageElements

Module MyModule
Sub Main()
' Create a PDF Document
Dim MyDocument As Document = New Document
' Create a Page and add it to the document
Dim MyPage As Page = New Page
MyDocument.Pages.Add(MyPage)

' Create a layout grid
Dim grid As LayoutGrid = New LayoutGrid(LayoutGrid.GridType.Decimal)

' Add a rectangle to the page
MyPage.Elements.Add(New Rectangle(50, 50, 50, 50, 2))

' Add the layout grid to the page
MyPage.Elements.Add(grid)

' Save the PDF
MyDocument.Draw("C:\MyDocument.pdf") End Sub
End Module
using System;
using ceTe.DynamicPDF;
using ceTe.DynamicPDF.PageElements;

class MyClass
{
static void Main()
{
// Create a PDF Document
Document document = new Document();

// Create a Page and add it to the document
Page page = new Page();
document.Pages.Add( page );

// Create a layout grid
LayoutGrid grid = new LayoutGrid( LayoutGrid.GridType.Decimal );

// Add a rectangle to the page
page.Elements.Add( new Rectangle( 50, 50, 50, 50, 2 ) );

// Add the layoutgrid to the page
page.Elements.Add( grid );

// Save the PDF
document.Draw( @"C:\MyDocument.pdf" );
}
}

Remarks​

This class can be used to place a grid on the entire page. This grid is very helpful with the design and layout of the document.

Constructors​

LayoutGrid()​

Initializes a new instance of the LayoutGrid class.

public LayoutGrid()
Public Sub New ()

LayoutGrid(Boolean)​

Initializes a new instance of the LayoutGrid class.

public LayoutGrid(bool showTitle)
Public Sub New (showTitle As Boolean)

Parameters​

This value specifies whether or not to display the grid's title information.

LayoutGrid(LayoutGrid.GridType)​

Initializes a new instance of the LayoutGrid class.

public LayoutGrid(GridType type)
Public Sub New (type As GridType)

Parameters​

Type of grid to display.

LayoutGrid(LayoutGrid.GridType, Boolean)​

Initializes a new instance of the LayoutGrid class.

public LayoutGrid(GridType type, bool showTitle)
Public Sub New (type As GridType, showTitle As Boolean)

Parameters​

Type of grid to display.

This value specifies whether or not to display the grid's title information.

Properties​

ID​

Gets or sets the ID of the page element. (Inherited from PageElement)

public string ID { get; set; }
Public Property ID As String

Property Value​

String

ShowTitle​

Gets or sets a value specifying whether or not to display the grids title information.

public bool ShowTitle { get; set; }
Public Property ShowTitle As Boolean

Property Value​

Boolean

Type​

Gets or sets the style of grid.

public GridType Type { get; set; }
Public Property Type As GridType

Property Value​

GridType

Methods​

Draw(PageWriter)​

Draws the layout grid to the given PageWriter object.

public void Draw(PageWriter writer)
Sub Draw(writer As PageWriter)

Parameters​

PageWriter object to receive the layout grid's output.

Equals(Object)​

Determines whether the specified Object is equal to the current Object . (Inherited from Object)

public bool Equals(Object obj)
Function Equals(obj As Object) As Boolean

Parameters​

The Object to compare with the current Object .

Returns​

true if the specified Object is equal to the current Object ; otherwise, false.

GetHashCode()​

Serves as a hash function for a particular type. (Inherited from Object)

public int GetHashCode()
Function GetHashCode() As Integer

Returns​

A hash code for the current Object .

GetType()​

Gets the Type of the current instance. (Inherited from Object)

public Type GetType()
Function GetType() As Type

Returns​

The Type instance that represents the exact runtime type of the current instance.

ToString()​

Returns a String that represents the current Object . (Inherited from Object)

public string ToString()
Function ToString() As String

Returns​

A String that represents the current Object .

See Also​

ceTe.DynamicPDF.PageElements