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
Type | Name | Methods |
---|---|---|
int | Type Gets the type of the text element. | get |
Methods
Public methods
Returns | Name |
---|---|
bool | IsNestable () |
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]
public Chapter(int number)
Arguments
Type | Name | Description |
---|---|---|
int | number |
Chapter [2/3]
public Chapter(Paragraph title, int number)
Arguments
Type | Name | Description |
---|---|---|
Paragraph | title | the Chapter title (as a Paragraph) |
int | number | the Chapter number |
Summary
Constructs a new Chapter.
Chapter [3/3]
public Chapter(string title, int number)
Arguments
Type | Name | Description |
---|---|---|
string | title | the Chapter title (as a string) |
int | number | the Chapter number |
Summary
Constructs a new Chapter.
Methods
IsNestable
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