Add LayoutGrid Page Element to PDF (.NET Core/Framework)
Adding a LayoutGrid Page element 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
- Create a
Document
object. - Create a
Page
object and add it to the Document instance. - Create a
LayoutGrid
object by specifying the Grid type. - Add a Rectangle to the Page instance (to test the LayoutGrid).
- Add the LayoutGrid instance to the Page instance.
- 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");
Over 75 Page Elements
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.
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.
DynamicPDF Core Suite Information
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.
- Java - DynamicPDF Generator for Java
- COM/ActiveX - DynamicPDF Generator for COM/ActiveX