iText is about to move the RTF functionality to an incubator and deprecate
this functionality. Unless someone can provide the answer on this list (and
even if they do), you might want to consider other options for RTF
generation.

Best wishes,

---mr. bean

>>> re >>>



Chris von See wrote:
> 
> I think I've found a problem with nesting of lists in RTF.  Running  
> the program below with PDF output produces nested lists three levels  
> deep with all sub-lists nested properly.  However, if you run the same  
> code with RTF output the third level of lists does not show as being  
> indented, although the numbering seems correct.  Is there something  
> that needs to be done differently for RTF?
> 
> Thanks,
> Chris
> 
> Test program:
> 
> import java.io.FileOutputStream;
> import java.io.IOException;
> 
> import com.lowagie.text.Chunk;
> import com.lowagie.text.Document;
> import com.lowagie.text.DocumentException;
> import com.lowagie.text.List;
> import com.lowagie.text.ListItem;
> import com.lowagie.text.pdf.PdfWriter;
> import com.lowagie.text.rtf.RtfWriter2;
> 
> 
> public class TestList {
> 
>          public static void main(String[] args) throws IOException,  
> DocumentException {
>                  Document document = new Document();
>                  RtfWriter2.getInstance(document, new  
> FileOutputStream("testlist.rtf"));
> //                PdfWriter.getInstance(document, new  
> FileOutputStream("testlist.pdf"));
>                  document.open();
>                  List list1 = new List(List.ALPHABETICAL, 20);
>          list1.add(new ListItem(new Chunk("Level 1 - Item 1")));
>          list1.add(new ListItem(new Chunk("Level 1 - Item 2")));
>          list1.add(new ListItem(new Chunk("Level 1 - Item 3")));
> 
>          List list2 = new List(List.ORDERED, 20);
>          list2.add(new ListItem(new Chunk("Level 2 - Item 1")));
>          list2.add(new ListItem(new Chunk("Level 2 - Item 2")));
> 
>          List list3 = new List(List.ORDERED, 20);
>          list3.add(new ListItem(new Chunk("Level 3 - Item 1")));
>          list3.add(new ListItem(new Chunk("Level 3 - Item 2")));
>          list3.add(new ListItem(new Chunk("Level 3 - Item 3")));
>          list3.add(new ListItem(new Chunk("Level 3 - Item 4")));
>          list2.add(list3);
> 
>          //list2.add(new ListItem(new Chunk("Level 2 - Item 3")));
>          list1.add(list2);
> 
>          list1.add(new ListItem(new Chunk("Level 1 - Item 4")));
> 
>          document.add(list1);
>                  document.close();
>          }
> }
> 
> PDF output:
> 
> 
> 
> RTF output:
> 
> 
> 
> 
> 
> ------------------------------------------------------------------------------
> Let Crystal Reports handle the reporting - Free Crystal Reports 2008
> 30-Day 
> trial. Simplify your report design, integration and deployment - and focus
> on 
> what you do best, core application coding. Discover what's new with
> Crystal Reports now.  http://p.sf.net/sfu/bobj-july
> _______________________________________________
> iText-questions mailing list
> iText-questions@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/itext-questions
> 
> Buy the iText book: http://www.1t3xt.com/docs/book.php
> Check the site with examples before you ask questions:
> http://www.1t3xt.info/examples/
> You can also search the keywords list:
> http://1t3xt.info/tutorials/keywords/
> 

-- 
View this message in context: 
http://old.nabble.com/Problem-in-nesting-of-lists-in-RTF--tp26379399p26379918.html
Sent from the iText - General mailing list archive at Nabble.com.


------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
iText-questions mailing list
iText-questions@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/itext-questions

Buy the iText book: http://www.1t3xt.com/docs/book.php
Check the site with examples before you ask questions: 
http://www.1t3xt.info/examples/
You can also search the keywords list: http://1t3xt.info/tutorials/keywords/

Reply via email to