Example usage for com.lowagie.text.rtf.text RtfParagraph RtfParagraph

List of usage examples for com.lowagie.text.rtf.text RtfParagraph RtfParagraph

Introduction

In this page you can find the example usage for com.lowagie.text.rtf.text RtfParagraph RtfParagraph.

Prototype

public RtfParagraph(RtfDocument doc, Paragraph paragraph) 

Source Link

Document

Constructs a RtfParagraph belonging to a RtfDocument based on a Paragraph.

Usage

From source file:com.ainfosec.macresponse.report.RtfGenerator.java

License:Open Source License

private static void addTitlePage() {
    Paragraph preface = new Paragraph();
    // We add one empty line
    preface.add(Chunk.NEWLINE);//from w  w w. j a va 2s.c  o  m
    // Lets write a big header
    preface.add(new Paragraph("MAC Response", chapterTitleFont));

    preface.add(Chunk.NEWLINE);
    // Will create: Report generated by: _name, _date
    preface.add(new Paragraph("Report generated by: " + System.getProperty("user.name") + ", " + new Date(), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
            contentFont));
    preface.add(Chunk.NEWLINE);
    preface.add(Chunk.NEWLINE);
    preface.add(Chunk.NEWLINE);
    preface.add(new Paragraph("This document describes something which is very important ", contentFont));

    document.add(new RtfParagraph(document, preface));
    // Start a new page
    // TODO Paul do this again
    //document.newPage();
}

From source file:com.ainfosec.macresponse.report.RtfGenerator.java

License:Open Source License

private static void addTables(TreeObject rootObject) {
    // TODO Paul add table of contents/etc.?
    // Table of Contents
    //document.add(new RtfTableOfContents("Table of Contents2"));
    Paragraph paragraph = new Paragraph();
    paragraph.add("Table of Contents\n\n");

    for (TreeObject treeObject : rootObject.getChildObjects()) {
        if (treeObject.isChecked()) {
            addTocSection(paragraph, treeObject, String.valueOf(currentChapter));
            currentChapter++;// ww  w . j  a v a 2s.  c  o  m
        }
    }
    currentChapter = 1;

    document.add(new RtfParagraph(document, paragraph));

    // Table of Figures
    // Table of Tables
}