A Section is a part of a Document containing other Sections, Paragraphs, List and/or Tables.

Namespace: iTextSharp.text
Assembly: ITextSharp (in ITextSharp.dll) Version: 4.1.6.0

Syntax

C#
public class Section : ArrayList, ITextElementArray, 
	ILargeElement, IElement
Visual Basic
Public Class Section _
	Inherits ArrayList _
	Implements ITextElementArray, ILargeElement, IElement
Visual C++
public ref class Section : public ArrayList, 
	ITextElementArray, ILargeElement, IElement

Remarks

You can not construct a Section yourself. You will have to ask an instance of Section to the Chapter or Section to which you want to add the new Section.

Examples

CopyC#
Paragraph title2 = new Paragraph("This is Chapter 2", FontFactory.GetFont(FontFactory.HELVETICA, 18, Font.BOLDITALIC, new Color(0, 0, 255)));
Chapter chapter2 = new Chapter(title2, 2);
Paragraph someText = new Paragraph("This is some text");
chapter2.Add(someText);
Paragraph title21 = new Paragraph("This is Section 1 in Chapter 2", FontFactory.GetFont(FontFactory.HELVETICA, 16, Font.BOLD, new Color(255, 0, 0)));
<strong>Section section1 = chapter2.AddSection(title21);</strong>
Paragraph someSectionText = new Paragraph("This is some silly paragraph in a chapter and/or section. It contains some text to test the functionality of Chapters and Section.");
<strong>section1.Add(someSectionText);</strong>
Paragraph title211 = new Paragraph("This is SubSection 1 in Section 1 in Chapter 2", FontFactory.GetFont(FontFactory.HELVETICA, 14, Font.BOLD, new Color(255, 0, 0)));
<strong>Section section11 = section1.AddSection(40, title211, 2);
section11.Add(someSectionText);</strong>strong>

Inheritance Hierarchy

See Also