Skip to main content
Skip table of contents

Chapter

Chapter Public class

Description

A Chapter is a special Section.

Diagram

  flowchart LR
  classDef interfaceStyle stroke-dasharray: 5 5;
  classDef abstractStyle stroke-width:4px
  subgraph iTextSharp.text
  iTextSharp.text.Chapter[[Chapter]]
  iTextSharp.text.Section[[Section]]
  end
iTextSharp.text.Section --> iTextSharp.text.Chapter

Members

Properties

Public properties
TypeNameMethods
intType
Gets the type of the text element.
get

Methods

Public methods
ReturnsName
boolIsNestable()

Details

Summary

A Chapter is a special Section.

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.

Example


            Paragraph title2 = new Paragraph("This is Chapter 2", FontFactory.GetFont(FontFactory.HELVETICA, 18, Font.BOLDITALIC, new BaseColor(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 BaseColor(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);
            

Inheritance

Constructors

Chapter [1/3]

Source code

public Chapter(int number)
Arguments
TypeNameDescription
intnumber
Chapter [2/3]

Source code

public Chapter(Paragraph title, int number)
Arguments
TypeNameDescription
Paragraphtitlethe Chapter title (as a Paragraph)
intnumberthe Chapter number
Summary

Constructs a new Chapter.

Chapter [3/3]

Source code

public Chapter(string title, int number)
Arguments
TypeNameDescription
stringtitlethe Chapter title (as a string)
intnumberthe Chapter number
Summary

Constructs a new Chapter.

Methods

IsNestable

Source code

public override bool IsNestable()

Properties

Type
public override int Type { get; }
Summary

Gets the type of the text element.

Value

a type

Generated with ModularDoc

JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.