Table of Contents

Class Chapter

Namespace
iTextSharp.text
Assembly
iTextSharp.LGPLv2.Core.dll

A Chapter is a special Section.

public class Chapter : Section, IList<IElement>, ICollection<IElement>, IList, ICollection, IReadOnlyList<IElement>, IReadOnlyCollection<IElement>, IEnumerable<IElement>, IEnumerable, ITextElementArray, ILargeElement, IElement
Inheritance
Chapter
Implements
Derived
Inherited Members
Extension Methods

Examples

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); chapter2.SetNumberDepth(0); 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))); Section section1 = chapter2.AddSection(title21); 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."); section1.Add(someSectionText);

Remarks

A chapter number has to be created using a Paragraph as title and an int as chapter number. The chapter number is shown be default. If you don't want to see the chapter number, you have to set the numberdepth to 0.

Constructors

Chapter(int)

Constructs a new Chapter .

public Chapter(int number)

Parameters

number int

the Chapter number

Chapter(string, int)

Constructs a new Chapter.

public Chapter(string title, int number)

Parameters

title string

the Chapter title (as a string)

number int

the Chapter number

Chapter(Paragraph, int)

Constructs a new Chapter.

public Chapter(Paragraph title, int number)

Parameters

title Paragraph

the Chapter title (as a Paragraph)

number int

the Chapter number

Properties

Type

implementation of the Element-methods

public override int Type { get; }

Property Value

int

a type

Methods

IsNestable()

@see com.lowagie.text.Element#isNestable() @since iText 2.0.8

public override bool IsNestable()

Returns

bool