Examples

Add LayoutGrid Page Element to PDF

Adding a LayoutGrid to a PDF using DynamicPDF Generator is straightforward.

How to Add LayoutGrid Page Element to PDF in C#

The following steps and sample code add a LayoutGrid to a PDF document using DynamicPDF Core Suite.

Steps for Adding LayoutGrid Page Element to a PDF Document

  1. Create a Document object.
  2. Create a Page object and add it to the Document instance.
  3. Create a LayoutGrid object by specifying the grid type.
  4. Add a Rectangle to the Page instance (to test the LayoutGrid).
  5. Add the LayoutGrid instance to the Page instance.
  6. Save the PDF document.

Sample Code - C#

Document document = new Document();
Page page = new Page();
document.Pages.Add(page);
            
LayoutGrid grid = new LayoutGrid(LayoutGrid.GridType.Decimal);
page.Elements.Add(new Rectangle(50, 50, 50, 50, 2));
page.Elements.Add(grid);
            
document.Draw(@"Output.pdf");

GitHub Project

Clone or view the example project at GitHub. This example code is contained in the Examples/LayoutGridExample.cs file.

Clone or View Example Project on GitHub

Getting Started

NuGet Package

DynamicPDF Core Suite is available on NuGet and is part of the ceTe.DynamicPDF.CoreSuite.NET package. The easiest way to install DynamicPDF Core Suite it through the Visual Studio Package Manager. You can also download the package directly from NuGet.

NuGet Package ID: ceTe.DynamicPDF.CoreSuite.NET

DynamicPDF Core Suite Information

DynamicPDF Core Suite contains over 75 page elements you can add rich content to the PDFs you create. Elements include:

  • Images,
  • Text Objects (TextArea and Label),
  • HTML,
  • Barcodes (47 types),
  • Form Fields,
  • and Charts.

More information can be found here at the following website.

Available on Other Platforms

DynamicPDF Core Suite is available for the Java and COM/ActiveX platforms. Refer to the respective product pages for more details.

Why Choose DynamicPDF?

  • Transparent Pricing
  • Lots of Features
  • Easy to Use
  • Great Support
  • Efficient Performance
  • Product Maturity (Over 22 Years)
  • Free Evaluation
  • .NET Core Support (Most Products)
  • Flexible Licensing

We’re Not The Only Ones That Think We’re Great!