Example usage for com.lowagie.text Chunk Chunk

List of usage examples for com.lowagie.text Chunk Chunk

Introduction

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

Prototype

public Chunk() 

Source Link

Document

Empty constructor.

Usage

From source file:com.opst.adminBean.java

public void preProcessPDF(Object document) throws IOException, BadElementException, DocumentException {
    Document pdf = (Document) document;
    pdf.open();//from   www  .j av a2 s.c o  m
    pdf.setPageSize(PageSize.A4);
    String string = "CTP Leaderboard - " + adminBean.firstandlast + " Week: " + adminBean.week;
    Chunk ch = new Chunk();
    pdf.add(new Chunk(string));
    pdf.add(Chunk.NEWLINE);
    pdf.add(Chunk.NEWLINE);
    pdf.add(new Chunk(" "));

}

From source file:org.tellervo.desktop.print.SeriesReport.java

License:Open Source License

private Chunk certaintyToNaturalString(String certainty) {
    Chunk c = new Chunk();

    if (certainty.equalsIgnoreCase("exact")) {
        c.append("in exactly ");
    } else if (certainty.equalsIgnoreCase("after")) {
        c.append("after ");
    } else if (certainty.equalsIgnoreCase("before")) {
        c.append("before ");
    } else {/*from   www. j a  va  2 s.co  m*/
        c.append("in " + certainty.toLowerCase() + " ");
    }

    c.setFont(bodyFont);
    return c;
}

From source file:rtf.shapes.RTFShapeTextWrap.java

/**
 * @param args// w w  w .j  a  v a  2  s  .  c o  m
 */
public static void main(String[] args) {
    Document document = new Document();

    try {
        RtfWriter2.getInstance(document, new FileOutputStream(resultsPath + outFile));
        document.open();
        Image logo = Image.getInstance(resourcePath + inFile1);

        Paragraph p = new Paragraph();
        Chunk c = new Chunk();
        c.append(
                "This is some text. This is some text. This is some text. This is some text. This is some text. This is some text. "
                        + "This is some text. This is some text. This is some text. This is some text. This is some text. This is some text. "
                        + "This is some text. This is some text. This is some text. This is some text. This is some text. This is some text. "
                        + "This is some text. This is some text. This is some text. This is some text. This is some text. This is some text. "
                        + "This is some text. This is some text. This is some text. This is some text. This is some text. This is some text. "
                        + "This is some text. This is some text. This is some text. This is some text. This is some text. This is some text. "
                        + "This is some text. This is some text. This is some text. This is some text. This is some text. This is some text. "
                        + "This is some text. This is some text. This is some text. This is some text. This is some text. This is some text. "
                        + "This is some text. This is some text. This is some text. This is some text. This is some text. This is some text. "
                        + "This is some text. This is some text. This is some text. This is some text. This is some text. This is some text. ");

        RtfShapePosition position = new RtfShapePosition(2000, 6000, 10500, 4500);
        RtfShape shape = new RtfShape(RtfShape.SHAPE_RECTANGLE, position);
        shape.setWrapping(RtfShape.SHAPE_WRAP_LEFT);
        shape.setProperty(new RtfShapeProperty(RtfShapeProperty.PROPERTY_IMAGE, logo));

        p.add(shape);
        p.add(c);
        document.add(p);
    } catch (FileNotFoundException e) {
        e.printStackTrace();
    } catch (BadElementException e) {
        e.printStackTrace();
    } catch (MalformedURLException e) {
        e.printStackTrace();
    } catch (IOException e) {
        e.printStackTrace();
    } catch (DocumentException e) {
        e.printStackTrace();
    }
    document.close();
}