Hi, On Tuesday 06 June 2006 10:26, Lorenz Maierhofer wrote: > - I created a few more styles (next to the default ones) and want to use > them in sections and in tables. This works for sections if I register > the styles in the DocumentSettings. But I had no luck with using styles > in tables. They are correctly formatted, but not associated to the > appropriate style. That is because styles are only applicable to Paragraph objects. Put the content in a Paragraph and set the style on that Paragraph and it should work.
> - About numbered sections/chapters: > Is there a way to or a plan to create RtfFields for the chapter/section > numbers (so e.g. Word will automatically put in the correct numbers and > will re-number them if one gets deleted)? I haven't looked at that and can't give a definitive time-frame. > - About soft linebreaks: > How can I use them when creating my document? > I found a method to configure them in RtfChunk, but I work with Chunks > that then get mapped to RtfChunks. So I think I do not have access to > configure the behavior. > Is there a way to flexibly insert softlinebreaks when creating a document? Currently there is only limited flexibility regarding soft line-breaks. Either all \n anywhere in the text are translated into soft line-breaks or into hard ones. This can be set via the writer2.getDocumentSettings().setAlwaysGenerateSoftLinebreaks(true/false). You could change that setting before you add content to the document and thus make the setting a bit more fine grained, but that's it. In the long run there might be a class to add direct rtf content and then it would be possible to add soft or hard linebreaks as desired. > - About table cells: > Is there a way to rotate the text of a table cell? > I tried to play with RtfCell.rotate(), but did not find out how to use > it or if it is supported in iText RtfWriter2. Not supported and I can't say whether or when it might be. > About chapters / sections: > When creating sections (with styles), I always got an additional > linebreak when a table or another section follows. This seems to be > caused by RtfParagraph, line 168. However, when I remove this block, > sections are missing the linebreak when a paragraph or a list follows. > Seems as if this is some sort of bug. My solution was to remove the > block in RtfParagraph and check in the RtfChapter and RtfSection where > items are added wether the elements are of a type that needs a > linebreak. Unfortunately this will only work if all paragraphs are in > chapters or sections... This is not caused by the code in RtfParagraph, but in RtfSection and RtfTable that adds an empty line before sections and tables in order to mimic the behaviour of the PdfWriter. You could simply comment out the result.write(RtfParagraph.PARAGRAPH) in the write methods of the two classes. Long term the RtfTable will gain support for the setOffset() method and then at least half of this problem will be solved. For RtfSection I'll have to look at what the pdf looks like and compare again. Greetings, Mark -- Q: Why did the WASP cross the road? A: To get to the middle. My GPG public key is available at: http://www.edu.uni-klu.ac.at/~mhall/data/security/MarkHall.asc
pgpI3VFdm11pA.pgp
Description: PGP signature
_______________________________________________ iText-questions mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/itext-questions
