On Wednesday 08 November 2006 16:25, [EMAIL PROTECTED] wrote:
> code sample:
>     com.lowagie.text.List content = new com.lowagie.text.List(false, 20);
>     Iterator contentIterator = contentList.iterator(); // This Iterator
> holds text i want to have in the list while(contentIterator.hasNext()){
>         String text = (String) contentIterator.next();
>         content.add(new ListItem(text));
>     }
>     RtfDocument doc = new RtfDocument(); // I don't use this document it's
> only used to generate the list code that is than glued into another
> document. RtfList listEl = new RtfList(doc,content);
>     String listElementStr = new String(listEl.write());
>
> The problem is my result is always a numbered list and if there was a
> numbered list before in the document it continues the enumeration.
Lists in RTF are pretty complicated things. They are split into two parts with 
some definitions being part of the document header and some definitions and 
the actual list being in the document area. I would recommend reading

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnrtfspec/html/rtfspec.asp

to understand how they work and then see how you can use RtfList.write() and 
RtfList.writeDefinition() to create the document area and document header 
parts and glue them in the right places. You might have to do some modifying 
of the RTF code returned by these codes to ensure that list ids are unique.

Your current problems stem from the fact that Word has no idea how the list is 
defined and falls back to its defaults.

Greetings,
Mark
-- 
Extreme fear can neither fight nor fly.
                -- William Shakespeare, "The Rape of Lucrece"

My GPG public key is available at:
http://www.edu.uni-klu.ac.at/~mhall/data/security/MarkHall.asc

Attachment: pgpIzAru9uyAI.pgp
Description: PGP signature

-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
iText-questions mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/itext-questions

Reply via email to