Example usage for com.lowagie.text Annotation Annotation

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

Introduction

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

Prototype

public Annotation(String title, String text) 

Source Link

Document

Constructs an Annotation with a certain title and some text.

Usage

From source file:jp.ac.utokyo.rcast.karkinos.graph.output.PdfReport.java

License:Apache License

private static void addObj(Document document, Object obj, int width, int hight, int size, PdfWriter writer,
        int figcount) throws Exception, IOException {
    if (obj instanceof JFreeChart) {

        JFreeChart chart = (JFreeChart) obj;
        BufferedImage bufferedImage = chart.createBufferedImage(width * size, hight * size);
        Image image = Image.getInstance(writer, bufferedImage, 1.0f);
        image.scalePercent(20);//from   w w  w. j a v  a 2s .  co  m
        image.setAnnotation(new Annotation("fig" + figcount, "karkinos fig" + figcount));
        document.add(image);

    } else if (obj instanceof Element) {

        document.add((Element) obj);

    } else if (obj instanceof java.awt.Image) {

        java.awt.Image aim = (java.awt.Image) obj;
        Image image = Image.getInstance(writer, aim, 1.0f);
        image.scalePercent(50);
        document.add(image);

    } else {

        document.add(new Paragraph(String.valueOf(obj)));

    }

}