Hiyas

I have an Rtf Document and want to create a header with text chunks that are 
assigned to tabs within a header.
Now.. my code creates a large Paragraph and wraps the RtfHeaderFooter around it 
and sets that to the RtfHeaderFooter. So far so good. This all works perfect 
until a paragraph 
contains subparagraphs (see sample below). When I use subparagraphs, the code 
seems to ignore the RtfTabs that are inside the Paragraph and adds only the 
Text chunks within.
This seems to have changed somewhere between 2.0.6 and 2.1.7 what I'm currently 
using. I think I can rewrite my code so it doesn't contain "subparagraphs" 
anymore, but I'm not sure 
whether this is a bug or if this has changed and is officially so.

Best regards,
Rog


     Document document = new Document();
     File fileName = new File("c:\\test.rtf");
     RtfWriter2 writer = RtfWriter2.getInstance(document, new 
FileOutputStream(fileName));
     document.open();

     RtfHeaderFooterGroup headerFooter = new RtfHeaderFooterGroup();
     Paragraph paragraph = new Paragraph();
     paragraph.add(new Chunk("Research"));
     paragraph.add(new RtfTab(532.9F, 2));
     paragraph.add(new Chunk("Customer"));
     paragraph.add(new Chunk("\n"));
     paragraph.add(new Chunk(""));
     Paragraph subParagraph = new Paragraph();
     subParagraph.add(new RtfTab(8000F, 2));
     subParagraph.add(new Chunk("\tKonto"));
     subParagraph.add(new Chunk("\n"));
     paragraph.add(subParagraph);

     headerFooter.setHeaderFooter(new RtfHeaderFooter(paragraph), 
RtfHeaderFooter.DISPLAY_ALL_PAGES);
     document.setHeader(headerFooter);
     document.close();

------------------------------------------------------------------------------
Come build with us! The BlackBerry® Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay 
ahead of the curve. Join us from November 9-12, 2009. Register now!
http://p.sf.net/sfu/devconf
_______________________________________________
iText-questions mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/itext-questions

Buy the iText book: http://www.1t3xt.com/docs/book.php
Check the site with examples before you ask questions: 
http://www.1t3xt.info/examples/
You can also search the keywords list: http://1t3xt.info/tutorials/keywords/

Reply via email to