Custom list symbol : List « PDF « Java Tutorial






import java.io.FileOutputStream;

import com.lowagie.text.Chunk;
import com.lowagie.text.Document;
import com.lowagie.text.List;
import com.lowagie.text.ListItem;
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();
    List list1 = new List(List.UNORDERED, 30);
    list1.setListSymbol(new Chunk('*'));
    list1.add(new ListItem("A"));
    list1.add(new ListItem("B"));
    list1.add(new ListItem("C"));
    document.add(list1);

    document.close();
  }
}








29.53.List
29.53.1.Create an Ordered list
29.53.2.Create an Unordered list
29.53.3.Alphabetical List
29.53.4.Add more space to list
29.53.5.Custom list symbol
29.53.6.RomanList, lower case
29.53.7.Upper case RomanList
29.53.8.Greek List
29.53.9.ZapfDingbatsList
29.53.10.zapfdingbatsnumberlist