1 package org.intix.itext.test;
2
3 import java.awt.Color;
4 import java.io.*;
5
6 import com.lowagie.text.*;
7 import com.lowagie.text.pdf.*;
8
9 class ChunkDemo
10 {
11 public static void main (String [] args) throws Exception
12 {
13 Document doc = new Document ();
14 PdfWriter.getInstance (doc, new FileOutputStream ("./test/chunkdemo.pdf"));
15 doc.open ();
16
17
18
19 Chunk chunk = new Chunk ("Hello");
20 doc.add (chunk);
21
22
23
24 chunk.setUnderline (0.2f, -2f);
25 doc.add (chunk);
26
27
28
29
30 chunk = new Chunk ("Goodbye");
31 chunk.setUnderline (0.5f, 3f);
32 doc.add (chunk);
33
34
35
36
37 chunk.setBackground (Color.yellow);
38 doc.add (chunk);
39
40 doc.close ();
41 }
42 }