Hi Chris,

after reading through your problem description, I've got some questions and 
remarks.

* Are you sure that what you want is really a list (from a semantic point of 
view)? If not you might be better of using Chapters and Sections (as somebody 
else pointed out).
* RTF is a markup language (more or less), which makes some things rather hard 
to do.
* Paragraphs and Tables automatically generate hard line-breaks, so that the 
list item ends before the hard line-break.
* setFirst(x) is currently not supported
* There is a bug somewhere in the handling of nested lists.

Unfortunately I currently don't have access to a computer running Word, so I 
can't provide any solutions. Additionally it would be nice if you could 
provide a simple runnable example to test your problems with. I hope to have 
access to Word again at the end of February, so then I will deal with the 
backlog of RTF issues.

Greetings,
Mark

On Wednesday 03 January 2007 15:04, Chris O'Connell wrote:
> I'm new to IText and I think it is a great tool. I wish I had discovered
> it 6 months ago before I started using Apache FOP to create PDF's. Ugh...
>
> Anyway, I now have to create a (what I thought was) a fairly simple
> report in word. I figured I could use IText to generate a .rtf file and
> stream it down to the browser with a content type of
> "application/vnd.ms-word", causing the browser to pop open Word and my
> problems are solved...
>
> Well, I can't quite figure out how to lay out the information that I
> need to display. I'm close, but not quite there. I will simplify it, but
> this is essentially what I want to put on the report:
>
> 4 List Header
> 4.1 First List Item Header
> text here. more stuff. description of the first list item
> [table]
> {page break]
> 4.2 Second List Item Header
> text here. stuff and stuff. description of the second list item.
> [table]
> [page break]
>
>
> And just repeat that pattern for a while. The way I'm trying to do this
> is first create a Document and an RtfWriter2. Then, I create what I call
> the 'outerList' and then create a ListItem which is a Paragraph with the
> text "List Header". Then add that item to the "outerList". Then, I
> create another List, calling it "innerList". I then add ListItems to the
> inner list. After I'm done adding the items to the "innerList", I add
> the "innerList" to the "outerList". Then, finally, add the "outerList"
> to the Document and close the Document.
>
> What happens is that first, I can't seem to get the {List Header} item
> to start with number 4. It always wants to start at number 1, despite
> calling "setFirst(4)". Next, I was hoping that the List Items would be
> numbered "4.1" and "4.2" etc. Instead, they just start out being
> numbered as "1", "2" etc.
>
> So, first, am I just way off base here? Am I trying to be too clever by
> using rtf to fake Word into displaying a Word doc? Second, it is
> possible to do what I want to do, which is have all that arbitrary
> content show up in between the list items? I haven't seen any examples
> of that, and no matter how I play around with things the items from "2"
> on down are no longer list items. They show up in my word document
> numbered correctly, but Word doesn't think they are list items, instead
> it just thinks that it is some text on a line that happens to start with
> the character "2", "3" etc.
>
> Any help you could give would be greatly appreciated. I've been playing
> around with this for a couple days and I'm starting to get bug-eyed and
> now I think that I am so surrounded by my confusion that I just need a
> push in the right direction from an outside source :)
>
> Thanks, Chris

-- 
Your life would be very empty if you had nothing to regret.

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

Attachment: pgp4zoqrJE27N.pgp
Description: PGP signature

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
iText-questions mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/itext-questions
Buy the iText book: http://itext.ugent.be/itext-in-action/

Reply via email to