Example usage for com.itextpdf.text Section setTitle

List of usage examples for com.itextpdf.text Section setTitle

Introduction

In this page you can find the example usage for com.itextpdf.text Section setTitle.

Prototype

public void setTitle(final Paragraph title) 

Source Link

Document

Sets the title of this section.

Usage

From source file:com.athena.chameleon.engine.utils.PDFWriterUtil.java

License:Apache License

/**
 * /*  ww w.  j a  va2 s.co  m*/
 * Section  ?
 *
 * @param chapter section?  chapter ?
 * @param text section title
 * @param sectionNo section Number
 * @return Section
 */
public static Section getSection(Section chapter, String text) {
    Section section = chapter.addSection(text);
    String title = section.getTitle().getContent();

    Chunk c;
    if (section.getDepth() >= 3) {
        c = new Chunk(text, fnSection2);
    } else {
        c = new Chunk(text, fnSection);
    }
    c.setLocalDestination(title);

    Paragraph sectionPh = new Paragraph();
    sectionPh.add(c);
    sectionPh.setSpacingBefore(8);
    sectionPh.setSpacingAfter(3);
    if (section.getDepth() >= 3)
        sectionPh.setIndentationLeft(23);

    section.setTitle(sectionPh);
    return section;
}