import java.awt.Color;
import java.io.FileOutputStream;
import com.lowagie.text.Chunk;
import com.lowagie.text.Document;
import com.lowagie.text.Font;
import com.lowagie.text.pdf.PdfContentByte;
import com.lowagie.text.pdf.PdfWriter;
public class MainClass {
public static void main(String[] args) throws Exception {
Document document = new Document();
PdfWriter.getInstance(document, new FileOutputStream("2.pdf"));
document.open();
Font font = new Font(Font.COURIER, 10, Font.BOLD);
font.setColor(new Color(0xFF, 0xFF, 0xFF));
Chunk fox = new Chunk("this is a ", font);
Chunk jumps = new Chunk(" test ", new Font());
Chunk dog = new Chunk(" another ", new Font(Font.TIMES_ROMAN, 14, Font.ITALIC));
dog.setUnderline(new Color(0xFF, 0x00, 0x00), 3.0f, 0.0f, -5.0f , 0.0f,
PdfContentByte.LINE_CAP_ROUND);
document.add(fox);
document.add(jumps);
document.add(dog);
document.close();
}
}