PDFListsAtoE.java Source code

Java tutorial

Introduction

Here is the source code for PDFListsAtoE.java

Source

import java.io.FileOutputStream;

import com.lowagie.text.Document;
import com.lowagie.text.List;
import com.lowagie.text.Paragraph;
import com.lowagie.text.html.HtmlWriter;
import com.lowagie.text.pdf.PdfWriter;

public class PDFListsAtoE {
    public static void main(String[] args) {
        Document document = new Document();
        try {
            PdfWriter.getInstance(document, new FileOutputStream("ListsAtoE.pdf"));
            document.open();

            Paragraph paragraph = new Paragraph("A to E:");
            List list = new List(false, 10);
            list.add("A");
            list.add("B");
            list.add("C");
            list.add("D");
            list.add("E");
            paragraph.add(list);
            document.add(paragraph);
        } catch (Exception ioe) {
            System.err.println(ioe.getMessage());
        }
        document.close();
    }
}