Hide the number of partitions and partitions in iTextSharp

I need to hide the number of sections and sections in the files that I generate using iTextSharp (in the contents of the file, I do not care about bookmarks), for example, I will need to change the actual result generated in this way

  • This is a Chapter Title 1

    1.1. This is in Title 1

in the following way:

This is a Chapter Title 1

This is in Title 1

I tried the following code, overriding the OnSection method:

public override void OnSection(PdfWriter writer, Document document, float paragraphPosition, int depth, Paragraph title)

    {title.RemoveAt(0);
        base.OnSection(writer, document, paragraphPosition, depth, title);
    }

But I did not get any results, can anyone help? Thanks a lot, Ariel

+5
source share
1 answer

A chapter int . . , numberdepth 0.

section.

:

Chapter chapter = new Chapter("ChapterTitle", 0);
chapter.NumberDepth = 0;

Section section = chapter.AddSection("Title", 0);
+8

All Articles