Leo wrote:
...no answer?!?

See attachment.
--
This answer is provided by 1T3XT BVBA
http://www.1t3xt.com/ - http://www.1t3xt.info
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.ColumnText;
import com.lowagie.text.pdf.MultiColumnText;
import com.lowagie.text.pdf.PdfWriter;

public class NestedLists {
        public static void main(String[] args) throws Exception {
                System.out.println("begin");

                Document document = new Document();
                PdfWriter writer = PdfWriter.getInstance(document, new 
FileOutputStream("lists.pdf"));
                document.open();

                List list = new List(true, 20);
                list.add(new ListItem("First line"));
                list.add(new ListItem("The second line is longer to see what 
happens once the end of the line is reached. Will it start on a new line?"));
                list.add(new ListItem("Third line"));
                
                List list2 = new List(true, 20);
                list2.add(new ListItem("First line"));
                list2.add(new ListItem("The second line is longer to see what 
happens once the end of the line is reached. Will it start on a new line?"));
                list2.add(new ListItem("Third line"));
                
                ListItem item = new ListItem();
                item.add(new Chunk("line 4"));
                list.add(item);
                list.add(list2);
                
                list.add(new ListItem("line 5"));
                document.add(list);
                document.newPage();
                
                ColumnText cols = new ColumnText(writer.getDirectContent());
                cols.setSimpleColumn(36, 36, 549, 806);
                cols.addElement(list);
                cols.go();

                document.close();

                System.out.println("done");
        }
}
------------------------------------------------------------------------------
Apps built with the Adobe(R) Flex(R) framework and Flex Builder(TM) are
powering Web 2.0 with engaging, cross-platform capabilities. Quickly and
easily build your RIAs with Flex Builder, the Eclipse(TM)based development
software that enables intelligent coding and step-through debugging.
Download the free 60 day trial. http://p.sf.net/sfu/www-adobe-com
_______________________________________________
iText-questions mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/itext-questions

Buy the iText book: http://www.1t3xt.com/docs/book.php

Reply via email to