Greek List Example
iText is a free and open source library for creating and manipulating
PDF documents in Java. The following example shows adding a GREEK list to PDF document.
package com.bethecoder.tutorials.itext.tests;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import com.itextpdf.text.Document;
import com.itextpdf.text.DocumentException;
import com.itextpdf.text.GreekList;
import com.itextpdf.text.List;
import com.itextpdf.text.PageSize;
import com.itextpdf.text.pdf.PdfWriter;
public class GreekListExample {
/**
* @param args
* @throws DocumentException
* @throws FileNotFoundException
*/
public static void main ( String [] args ) throws FileNotFoundException, DocumentException {
Document document = new Document ( PageSize.A4 ) ;
PdfWriter.getInstance ( document, new FileOutputStream ( "test18.pdf" )) ;
//Open the document before adding any content
document.open () ;
List list = new GreekList () ;
list.add ( "ONE" ) ;
list.add ( "TWO" ) ;
list.add ( "THREE" ) ;
list.add ( "FOUR" ) ;
document.add ( list ) ;
//Close the document
document.close () ;
}
}
It gives the following output,