cete.dynamicpdf.sectionlist
SectionList
- Namespace: ceTe.DynamicPDF
- Assemblies: ceTe.DynamicPDF.40.dll
Represents a collection of sections associated with a document.
public class SectionList
Public Class SectionList
Inheritance: Object → SectionList
Licensing
This class is a DynamicPDF Generator Community Edition feature.
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;
class MyClass
{static void Main(){ // 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( @"C:\MyDocument.pdf" );}
}
Remarks
For more details on sections take a look at the Document Sectioning topic.
Methods
Begin()
Begins a section in the document.
public Section Begin()
Function Begin() As Section
Returns
The Section object that was begun.
Begin(NumberingStyle)
Begins a section in the document.
public Section Begin(NumberingStyle numberingStyle)
Function Begin(numberingStyle As NumberingStyle) As Section
Parameters
- numberingStyle: NumberingStyle
The NumberingStyle to use for the section.
Returns
The Section object that was begun.
Begin(NumberingStyle, String)
Begins a section in the document.
public Section Begin(NumberingStyle numberingStyle, string prefix)
Function Begin(numberingStyle As NumberingStyle, prefix As String) As Section
Parameters
- numberingStyle: NumberingStyle
The NumberingStyle to use for the section.
- prefix: String
The prefix to use for the section.
Returns
The Section object that was begun.
Begin(NumberingStyle, String, Template)
Begins a section in the document.
public Section Begin(NumberingStyle numberingStyle, string prefix, Template template)
Function Begin(numberingStyle As NumberingStyle, prefix As String, template As Template) As Section
Parameters
- numberingStyle: NumberingStyle
The NumberingStyle to use for the section.
- prefix: String
The prefix to use for the section.
- template: Template
The Template to use for the section.
Returns
The Section object that was begun.
Begin(NumberingStyle, Template)
Begins a section in the document.
public Section Begin(NumberingStyle numberingStyle, Template template)
Function Begin(numberingStyle As NumberingStyle, template As Template) As Section
Parameters
- numberingStyle: NumberingStyle
The NumberingStyle to use for the section.
- template: Template
The Template to use for the section.
Returns
The Section object that was begun.
Begin(String)
Begins a section in the document.
public Section Begin(string prefix)
Function Begin(prefix As String) As Section
Parameters
- prefix: String
The prefix to use for the section.
Returns
The Section object that was begun.
Begin(String, Template)
Begins a section in the document.
public Section Begin(string prefix, Template template)
Function Begin(prefix As String, template As Template) As Section
Parameters
- prefix: String
The prefix to use for the section.
- template: Template
The Template to use for the section.
Returns
The Section object that was begun.
Begin(Template)
Begins a section in the document.
public Section Begin(Template template)
Function Begin(template As Template) As Section
Parameters
- template: Template
The Template to use for the section.
Returns
The Section object that was begun.
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
- obj: Object
The Object to compare with the current Object .
Returns
true if the specified Object is equal to the current Object ; otherwise, false.
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 .
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.
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 .