List of usage examples for com.itextpdf.text Section addSection
public Section addSection(final float indentation, final String title)
Section
to this Section
and returns it. 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); }