He does a bit, but nevertheless managed to miss this question.

Due to the differences between PDF and RTF rendering, in the RTF output you 
need to set the underline in the Font. Either via the constructor or via the 
setStyle(Font.UNDERLINE) method.

Greetings,
Mark

On Wednesday 16 January 2008, Bruno Lowagie wrote:
> I don't know if Mark speaks French, but the question is:
> "How to underline Chunk objects in RTF?"
> br,
> Bruno
>
> valerie marc wrote:
> > Bonjour,
> >
> > Je voudrais doublement souligner dans l'objet Chunck.
> > J'ai essayé le code mis sur votre site qui fonctionne
> > tres bien pour un document Pdf, mais ensuite j'ai
> > voulu faire le meme travail pour un document Rtf, et
> > la je ne vois aucun trait apparaitre dans mon document
> > ...
> >
> > Peux t'on doublement souligner pour un document Rtf ?
> >
> > Merci d'avance,
> >
> > Valerie
> >
> >
> > Code utilisé de votre site :
> >
> > // step 3: we open the document
> > document.Open();
> > // step 4:
> > Chunk underlined = new Chunk("underlined");
> > underlined.SetUnderline(0.2f, -2f);
> > Paragraph p = new Paragraph("The following chunk is
> > ");
> > p.Add(underlined);
> > document.Add(p);
> > Chunk strikethru = new Chunk("strike through
> > example");
> >
> > strikethru.SetUnderline(0.5f, 3f);
> > document.Add(strikethru);
> > document.Add(Chunk.NEWLINE);
> > document.Add(Chunk.NEWLINE);
> > document.Add(Chunk.NEWLINE);
> > Chunk c;
> > c = new Chunk("Multiple lines");
> > c.SetUnderline(new iTextSharp.text.Color(0xFF, 0x00,
> > 0x00), 0.0f, 0.3f, 0.0f, 0.4f,
> > PdfContentByte.LINE_CAP_ROUND);
> > c.SetUnderline(new iTextSharp.text.Color(0x00, 0xFF,
> > 0x00), 5.0f, 0.0f, 0.0f, -0.5f,
> > PdfContentByte.LINE_CAP_PROJECTING_SQUARE);
> > c.SetUnderline(new iTextSharp.text.Color(0x00, 0x00,
> > 0xFF), 0.0f, 0.2f, 15.0f, 0.0f,
> > PdfContentByte.LINE_CAP_BUTT);
> > document.Add(c);
> > document.Add(Chunk.NEWLINE);
> > document.Add(Chunk.NEWLINE);
> > document.Add(Chunk.NEWLINE);
> > c = new Chunk("Multiple lines",
> > FontFactory.GetFont(FontFactory.HELVETICA, 24));
> > c.SetUnderline(new iTextSharp.text.Color(0xFF, 0x00,
> > 0x00), 0.0f, 0.3f, 0.0f, 0.4f,
> > PdfContentByte.LINE_CAP_ROUND);
> > c.SetUnderline(new iTextSharp.text.Color(0x00, 0xFF,
> > 0x00), 5.0f, 0.0f, 0.0f, -0.5f,
> > PdfContentByte.LINE_CAP_PROJECTING_SQUARE);
> > c.SetUnderline(new iTextSharp.text.Color(0x00, 0x00,
> > 0xFF), 0.0f, 0.2f, 15.0f, 0.0f,
> > PdfContentByte.LINE_CAP_BUTT);
> > document.Add(c);
> >
> > document.Close();



-- 
He that breaks a thing to find out what it is has left the path of wisdom.
                -- J.R.R. Tolkien

My GPG public key is available at:
http://www.room3b.eu/data_box/download?path=%2Fsecurity%2FMarkHall.asc

Attachment: signature.asc
Description: This is a digitally signed message part.

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
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