Example usage for com.itextpdf.text Section addSection

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

Introduction

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

Prototype

public Section addSection(final float indentation, final String title) 

Source Link

Document

Adds a Section to this Section and returns it.

Usage

From source file:com.centurylink.mdw.pdf.PdfExportHelper.java

License:Apache License

private void printAttributes(Section section, List<Attribute> attrs, int parentLevel) {
    Paragraph sTitle = new Paragraph("Activity Attributes", subSectionFont);
    Section subsection = section.addSection(sTitle, parentLevel == 0 ? 0 : (parentLevel + 1));
    com.itextpdf.text.List list = new com.itextpdf.text.List(false, false, 20.0f);
    for (Attribute attr : attrs) {
        if (excludeAttribute(attr.getAttributeName(), attr.getAttributeValue()))
            continue;
        Phrase phrase = new com.itextpdf.text.Phrase();
        phrase.add(new Chunk(attr.getAttributeName(), fixedWidthFont));
        String v = attr.getAttributeValue();
        if (v == null)
            v = "";
        phrase.add(new Chunk(": " + v, normalFont));
        list.add(new ListItem(phrase));
    }//from   w w  w . j a v a  2  s .c om
    subsection.add(list);
}