Example usage for com.itextpdf.text Chapter setTriggerNewPage

List of usage examples for com.itextpdf.text Chapter setTriggerNewPage

Introduction

In this page you can find the example usage for com.itextpdf.text Chapter setTriggerNewPage.

Prototype

public void setTriggerNewPage(final boolean triggerNewPage) 

Source Link

Document

Setter for property triggerNewPage.

Usage

From source file:pdf.PdfUtility.java

private void addData(Document document) {
    List<? extends Achievement> allData = ServiceLocator.findLifetimeService().getAchievements(userId,
            language);// ww  w . j av a  2  s.  c om
    Collections.sort(allData, comparator);

    Chapter info = new Chapter(getSectionTitle(getTranslation("Achievements", language)), 0);
    info.setNumberDepth(0);
    info.setTriggerNewPage(false);

    boolean first = true;
    for (Achievement a : allData) {
        if (isInRange(a)) {
            achievements.add(a);
            Paragraph current = addTableEntry(a);
            if (first) {
                current.setSpacingBefore(5f);
            }
            info.addSection(current, 0);
        }
    }
    //info.add(Chunk.NEWLINE);
    try {
        document.add(info);
    } catch (DocumentException ex) {
        Logger.getLogger(PdfUtility.class.getName()).log(Level.SEVERE, null, ex);
    }
}