Section
Represents a section associated with a document.
public class Section
Public Class Section
Inheritance: ObjectSection
Licensing Info
This class is a DynamicPDF Core Suite Essentials feature. One of the following is required for non-evaluation usage:
- Any active DynamicPDF Subscription (Essentials, Professional, Professional Plus or Ultimate).
- A DynamicPDF Core Suite for .NET v12.X Essentials license.
- It can also be used for free with a public link back to www.dynamicpdf.com and with the DynamicPDF Essentials message displaying on the bottom of each page.
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. |
PageIndex | Gets the page index for the start of the section. |
Prefix | Gets or sets the prefix string for the section. |
StampTemplate | Gets or sets the StampTemplate for the section. |
StartingPageNumber | Gets or sets the starting page number for the section. |
Template | Gets or sets the Template for the section. |
Methods
Equals(Object) | Determines whether the specified Object is equal to the current Object . (Inherited from Object) |
GetHashCode() | Serves as a hash function for a particular type. (Inherited from Object) |
GetType() | Gets the Type of the current instance. (Inherited from Object) |
ToString() | Returns a String that represents the current Object . (Inherited from Object) |