#1 (rtf) lists within paragraph

closed-later
nobody
None
5
2003-10-10
2003-04-23
Jeremy Brown
No

I have a method that returns a paragraph object wich
sometimes contains lists mixed in with other text. What
I see when using an RTF Writer is that everything within
the paragarph following the first list is treated as a list
item.

Here is example code (also attached)

static void Main(string[] args){

System.IO.DirectoryInfo dirInfo = new
System.IO.DirectoryInfo("Output");
if(dirInfo.Exists){

System.IO.FileInfo[] files = dirInfo.GetFiles();
for(int i = 0;
i < files.Length; i++){

files[i].Delete();
}//for;
}else{

dirInfo.Create();
}//if;

Document document =
new Document();

PdfWriter pdfWriter =
PdfWriter.getInstance(document, new FileOutputStream
("Output/Test.pdf"));
HtmlWriter htmlWriter
= HtmlWriter.getInstance(document, new
FileOutputStream("Output/Test.html"));
RtfWriter rtfWriter =
RtfWriter.getInstance(document, new FileOutputStream
("Output/Test.rtf"));

document.open();

Paragraph para = new
Paragraph();
para.add(new
Paragraph("First Title"));
List list = new List
(false, false, 10);
list.setListSymbol(new
Chunk("\u2022"));

//1st list, 1st item.
ListItem firstItem =
new ListItem();
firstItem.add(new
Chunk("Blah Blah "));
firstItem.add(new
Chunk(" words words words "));
list.add(firstItem);

//1st list, 2nd item
ListItem secondItem =
new ListItem();
secondItem.add(new
Chunk("2nd item"));
secondItem.add(new
Chunk(", more of the 2nd item"));
list.add(secondItem);

//1st list, 3rd item
list.add(new ListItem
("3rd item"));

para.add(list);

//some non list stuff
para.add(new Chunk
("\n\n"));
para.add(new
Paragraph("Second Title"));
para.add(new Chunk
("a bunch of text similuating a non-list paragraph"));
para.add(new Chunk("
all 111-111-1111 "));
para.add(new Chunk("
Mon-Fri 6am-4pm PST."));
para.add(new Chunk
("\n\n"));

para.add(new
Paragraph("Third Title"));

//second list
List list2 = new List
(false, false, 10);
list2.setListSymbol
(new Chunk("\u2022"));

//2nd list, 1st item
ListItem firstItem2 =
new ListItem();
firstItem2.add(new
Chunk("1st item in second list"));
list2.add(firstItem2);

//2nd list, 2nd item
ListItem secondItem2
= new ListItem();
secondItem2.add(new
Chunk("Sign up today, call us at "));
secondItem2.add(new
Chunk("111-111-1111"));
secondItem2.add(new
Chunk(" or visit "));
Anchor anchor = new
Anchor("www.google.com");
anchor.setReference
("http://www.google.com");

secondItem2.add
(anchor);
list2.add(secondItem2);

para.add(list2);
para.add(new Chunk
("\n\n"));

document.add(para);

document.close();
}//main;

Discussion

  • Jeremy Brown
    Jeremy Brown
    2003-04-23

    Main, example code

     
    Attachments
  • Kazuya Ujihara
    Kazuya Ujihara
    2003-04-25

    • status: open --> open-postponed
     
  • Kazuya Ujihara
    Kazuya Ujihara
    2003-04-25

    Logged In: YES
    user_id=734754

    //

     
  • Kazuya Ujihara
    Kazuya Ujihara
    2003-04-25

    Logged In: YES
    user_id=734754

    RTF module is maintained by Mark Hall
    <http://sourceforge.net/sendmessage.php?touser=586735>
    in iText project <http://sourceforge.net/cvs/?
    group_id=15255>. Please post it there.

     
  • Jeremy Brown
    Jeremy Brown
    2003-04-28

    Logged In: YES
    user_id=305129

    Thanks, I sent to Mark. Did you get my previous emails?

     
  • Kazuya Ujihara
    Kazuya Ujihara
    2003-04-29

    Logged In: YES
    user_id=734754

    Yes. I returned it. But, your mail server reject it. I don't know
    why.

     
  • Kazuya Ujihara
    Kazuya Ujihara
    2003-05-10

    • labels: 520976 -->
    • status: open-postponed --> open-later
     
  • Kazuya Ujihara
    Kazuya Ujihara
    2003-10-10

    • status: open-later --> closed-later