iText is a free and open source library for creating and manipulating
PDF documents in Java. The following example shows adding a numbered list to PDF document.
Document document = new Document(PageSize.A4);
PdfWriter.getInstance(document, new FileOutputStream("test13.pdf"));
//Open the document before adding any content
document.open();
List numberedList = new List(true); //Create numbered list
numberedList.add("ONE");
numberedList.add("TWO");
numberedList.add("THREE");
numberedList.add("FOUR");
document.add(numberedList);
document.add(Chunk.NEWLINE); //Add a new line
List numberedList2 = new List(true); //Create numbered list
numberedList2.setFirst(1000); //First number in the list
numberedList2.setPostSymbol(":- "); //The symbol to be appended to each item
numberedList2.setPreSymbol("|-->"); //The symbol to be prepended to each item