Here is a code sample and the resulting PDF and RTF file from the output.
Document document = new Document();
RtfWriter2 writer = RtfWriter2.getInstance(document, new
FileOutputStream("TestListIndent.rtf"));
PdfWriter pwriter = PdfWriter.getInstance(document, new
FileOutputStream("TestListIndent.pdf"));
document.open();
List list = new List(true, 100); // big indent after symbol
list.add(new ListItem("First line"));
list.add(new ListItem("The second "));
list.add(new ListItem("Third line"));
document.add(list);
list = new List(true, 50); // smaller indent after symbol.
list.add(new ListItem("List 2 First line"));
list.add(new ListItem("List 2 The second "));
list.add(new ListItem("List 2 Third line"));
document.add(list);
list = new List(true, 100); // big indent after symbol
list.setIndentationLeft(50); // adjust left indent before symbol
list.add(new ListItem("First line"));
list.add(new ListItem("The second "));
list.add(new ListItem("Third line"));
document.add(list);
list = new List(true, 50); // small indent after symbol
list.setIndentationLeft(100); // adjust left indent to be a large
indent before symbol
list.add(new ListItem("List 2 First line"));
list.add(new ListItem("List 2 The second "));
list.add(new ListItem("List 2 Third line"));
document.add(list);
document.close();----- Original Message ---- From: Howard Shank <[EMAIL PROTECTED]> To: [email protected] Sent: Thursday, May 22, 2008 10:55:00 AM Subject: [iText-questions] RTF List indentations explained Hi Michael, I will try to explain the indents here. There are 2 indents when working with lists. Here is a simple example. <indent1>SYMBOL<indent2>List text follows here <indent1> is the Left Indentation value. <indent2> is the Symbol Indent value. You can use the method List.setIndentationLeft(float indentation) to modify value <indent1>. i.e. List.setIndenationLeft(75); There is no method at this time to modify the <indent2> value, it must be set at the time you create the list. i.e. List list = new List(true, 100); // Create a numbered list and set the <indent2> value to 100 If you look at the constructors for the List class you will see a couple different implementations you can use to create your list and set the <indent2> value at time of instantiation. Regards, Howard Shank ----- Original Message ---- From: "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> To: [EMAIL PROTECTED] Sent: Wednesday, May 21, 2008 5:12:29 PM Subject: rtf sry ive read it but my english isnt so good... why cant wordpad show this picture? maybe you can explain the two different idents? I had all indents i found in the api in the code, but nothing happend. The space between symbol and text is still too wide. ------------------------------------------------------------------------- This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2008. http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ _______________________________________________ iText-questions mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/itext-questions Do you like iText? Buy the iText book: http://www.1t3xt.com/docs/book.php Or leave a tip: https://tipit.to/itexttipjar
TestListIndent.pdf
Description: Adobe PDF document
TestListIndent.rtf
Description: MS-Word document
------------------------------------------------------------------------- This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2008. http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________ iText-questions mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/itext-questions Do you like iText? Buy the iText book: http://www.1t3xt.com/docs/book.php Or leave a tip: https://tipit.to/itexttipjar
