Add Section to PDF (.NET Core/Framework)

Adding Section to PDF using DynamicPDF Core Suite is straightforward. Documents can be broken into Sections has following benefits

How to Add Section to PDF in C#

Below are the steps and sample code to add an Section to PDF document using the Generator product.

  1. Can use the section numbering options of the Page Numbering Label Page Element.
  2. Can use section templates to apply Page Elements to all pages in a section.
  3. Can control the page labels that are displayed in a PDF viewer.

Steps for Adding Sections in a PDF Document

  1. Create a Document object.
  2. Create a Template object and add a page numbering label.
  3. Begin the Section on the document and add as many pages.
  4. Create as many Sections as required and add pages to those sections
  5. Save the PDF document.

Sample Code - C#

Document document = new Document();
Template template = new Template();
template.Elements.Add( new PageNumberingLabel( "%%SP%% of %%ST%%", 0, 680, 512, 12, Font.Helvetica, 12, TextAlign.Center ) );

document.Sections.Begin( NumberingStyle.RomanLowerCase );
document.Pages.Add( new Page() ); //Page 1
document.Pages.Add( new Page() ); //Page 2

document.Sections.Begin( NumberingStyle.Numeric, template );
document.Pages.Add( new Page() ); //Page 3
document.Pages.Add( new Page() ); //page 4
document.Pages.Add( new Page() ); //page 5

document.Sections.Begin( NumberingStyle.RomanLowerCase, "Appendix A - " );
document.Pages.Add( new Page() ); //page 6
document.Pages.Add( new Page() ); //page 7


Over 75 Page Elements

DynamicPDF Generator contains over 75 page elements so you can add rich content to the PDFs you create:

  • Images
  • Text Objects (TextArea and Label)
  • HTML
  • Barcodes (47 types)
  • Form Fields
  • 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 the package is 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

More information can be found on the DynamicPDF Core Suite webpage.

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 18 Years)
  • Free Evaluation
  • .NET Core Support (Most Products)
  • Flexible Licensing

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