The RtfDirectContent class works like a Chunk and can thus be added anywhere 
you can add a Chunk (Paragraphs, Cells, ListItems,...). I would suggest you 
read through the iText tutorial to understand how to correctly use the iText 
library. Especially the chapter on basic building building blocks and the rtf 
section.

http://itextdocs.lowagie.com/tutorial/
http://itextdocs.lowagie.com/tutorial/objects/index.html
http://itextdocs.lowagie.com/tutorial/rtf/features/direct/index.html

Greetings,
Mark

On Sunday 16 September 2007, Xuyun Fu wrote:
> Mark Hall-6 wrote:
> > You can use the com.lowagie.text.rtf.direct.RtfDirectContent class to add
> > arbitrary RTF code at any place in the document. You will have to strip
> > any
> > RTF header information and similar yourself, as otherwise you will
> > probably
> > end up with an invalid document.
> >
> > Greetings,
> > Mark
>
> Thanks for your reply so quickly. Do you mean the
> com.lowagie.text.rtf.direct.RtfDirectContent class's
> writeContent(OutputStream out) method? I don't know how to use it
> correctly. Please look at my code:
>
>     RtfWriter2 writer=RtfWriter2.getInstance(document, new
> FileOutputStream("C:\\HelloWorld.rtf"));
>     writer.open();
>     Table table=new Table(1);
>     writer.add(table);
>
>     RtfDirectContent rtfDirectContent=new RtfDirectContent("\par Hello,
> world!\cell");
>     //I want to add rtfdirectContent to this table, but I don't know how to
> do it.
>
>     writer.close();
>
> I don't know if I can use RtfWriter2 and RtfDirectContent.writeContent in
> the same time. Please help me.
>
> Thanks for your reply.



-- 
Q:      How many psychiatrists does it take to change a light bulb?
A:      Only one, but it takes a long time, and the light bulb has
        to really want to change.

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

Attachment: pgpgk0urIyAz7.pgp
Description: PGP signature

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
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