Skip to main content

Section

Version: 12.0

cete.dynamicpdf.section

Section​

Represents a section associated with a document.

public class Section
Public Class Section

Inheritance: Object → Section

Licensing Info​

This class is a DynamicPDF Core Suite Essentials feature. One of the following is required for non-evaluation usage:

Examples​

This example shows how to break the document into different sections.

Imports System
Imports ceTe.DynamicPDF

Module MyModule

Sub Main()

' Create a PDF Document
Dim MyDocument As Document = New Document

'Create a template object and add a page numbering label
Dim MyTemplate As Template = New Template
MyTemplate.Elements.Add(New PageNumberingLabel("%%SP%% of %%ST%%", 0, 680, 512, 12, Font.Helvetica, 12, TextAlign.Center))

'Add the template to the document
MyDocument.Template = MyTemplate

'Begin the first section
MyDocument.Sections.Begin(NumberingStyle.RomanLowerCase)
'Add two pages
MyDocument.Pages.Add(New Page) 'Page 1
MyDocument.Pages.Add(New Page) 'Page 2

'Begin the second section
MyDocument.Sections.Begin(NumberingStyle.Numeric, MyTemplate)
'Add three pages
MyDocument.Pages.Add(New Page) 'Page 3
MyDocument.Pages.Add(New Page) 'page 4
MyDocument.Pages.Add(New Page) 'page 5

'Begin the third section specifying a section prefix
MyDocument.Sections.Begin(NumberingStyle.RomanLowerCase, "Appendix A - ")
'Add two pages
MyDocument.Pages.Add(New Page) 'page 6
MyDocument.Pages.Add(New Page) 'page 7

' Save the PDF document
MyDocument.Draw("C:\MyDocument.pdf")

End Sub
End Module
using System;
using ceTe.DynamicPDF;
using ceTe.DynamicPDF.PageElements;

public class Example
{
public static void CreatePDF(string outputPath)
{
// Create a PDF Document
Document document = new Document();

//Create a template object and add a page numbering label
Template template = new Template();
template.Elements.Add(new PageNumberingLabel("%%SP%% of %%ST%%", 0, 680, 512, 12, Font.Helvetica, 12, TextAlign.Center));

document.Template = template;

//Begin the first section
document.Sections.Begin(NumberingStyle.RomanLowerCase);
//Add two pages
document.Pages.Add(new Page()); //Page 1
document.Pages.Add(new Page()); //Page 2

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

//Begin the third section specifying a section prefix
document.Sections.Begin(NumberingStyle.RomanLowerCase, "Appendix A - ");
//Add two pages
document.Pages.Add(new Page()); //page 6
document.Pages.Add(new Page()); //page 7

// Save the PDF document
document.Draw(outputPath);
}
}

Remarks​

For more details on sections take a look at the Document Sectioning topic.

Properties​

NumberingStyle​

Gets or sets the numbering style for the section.

public NumberingStyle NumberingStyle { get; set; }
Public Property NumberingStyle As NumberingStyle

Property Value​

NumberingStyle

Licensing Info​

This property is a full DynamicPDF Core Suite feature. One of the following is required for non-evaluation usage:

PageIndex​

Gets the page index for the start of the section.

public int PageIndex { get; }
Public Property PageIndex As Int32

Property Value​

Int32

Licensing Info​

This property is a full DynamicPDF Core Suite feature. One of the following is required for non-evaluation usage:

Prefix​

Gets or sets the prefix string for the section.

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

Property Value​

String

Licensing Info​

This property is a full DynamicPDF Core Suite feature. One of the following is required for non-evaluation usage:

StampTemplate​

Gets or sets the StampTemplate for the section.

public Template StampTemplate { get; set; }
Public Property StampTemplate As Template

Property Value​

Template

Licensing Info​

This property is a full DynamicPDF Core Suite feature. One of the following is required for non-evaluation usage:

Remarks​

This stamp template will be used for all pages in this section that have their ApplySectionTemplate property set to true (the default value).

StartingPageNumber​

Gets or sets the starting page number for the section.

public int StartingPageNumber { get; set; }
Public Property StartingPageNumber As Int32

Property Value​

Int32

Licensing Info​

This property is a full DynamicPDF Core Suite feature. One of the following is required for non-evaluation usage:

Remarks​

This must be a value greater than or equal to 1.

Template​

Gets or sets the Template for the section.

public Template Template { get; set; }
Public Property Template As Template

Property Value​

Template

Licensing Info​

This property is a full DynamicPDF Core Suite feature. One of the following is required for non-evaluation usage:

Remarks​

This template will be used for all pages in this section that have their ApplySectionTemplate property set to true (the default value).

Methods​

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.

Licensing Info​

This method is a full DynamicPDF Core Suite feature. One of the following is required for non-evaluation usage:

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 .

Licensing Info​

This method is a full DynamicPDF Core Suite feature. One of the following is required for non-evaluation usage:

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.

Licensing Info​

This method is a full DynamicPDF Core Suite feature. One of the following is required for non-evaluation usage:

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 .

Licensing Info​

This method is a full DynamicPDF Core Suite feature. One of the following is required for non-evaluation usage:

See Also​

ceTe.DynamicPDF