Hi,
thanks for  the answer,
but when I try to draw a border around my text, the border is exactly what I
like it to be, and the text exceed the border downwards.
But, to be sure I will try this in the evening or tomorrow.

Peter


> -----Ursprüngliche Nachricht-----
> Von: 1T3XT info [mailto:i...@1t3xt.info]
> Gesendet: Mittwoch, 14. Juli 2010 08:45
> An: Post all your questions about iText here
> Betreff: Re: [iText-questions] ColumnText
> 
> Peter Forstmeier wrote:
> > Hi List,
> > i would like to add some variable length Text at a give location and
> a given
> > Height and Width:
> >
> > PdfContentByte cb = base.PdfWriter.DirectContent;
> >
> > iTextSharp.text.Rectangle r = base.ConvertToPdfRectangle();
> >
> > ColumnText ct = new ColumnText(cb);
> >
> > PdfFormat pdfFormat = new PdfFormat(this.StyleDecorator,font);
> >
> > ct.SetSimpleColumn(r.Left, r.Top , r.Left +
> > r.Width,r.Height,pdfFormat.Leading,pdfFormat.Alignment);
> >
> > string formated =
> >
> StandardFormatter.FormatOutput(this.text,this.StyleDecorator.FormatStri
> ng,
> >
> > this.StyleDecorator.DataType,String.Empty);
> >
> > hunk chk = new Chunk(formated,font);
> > ct.AddText(chk);
> > ct.Go();
> >
> > Where pdfFormat.Leading is set to FontSize.Height andf the Rextangle
> is set
> > correctly.
> >
> > The width of the rectangle is used correct. Means text is wrapped
> correctly.
> >
> > Problem: It seems that ColumnText is ignoring the Height of the given
> > Rectangle.
> > If the text is longer, the output is drawn over the rectangle
> boundaries.
> >
> > Is there any chance to let ColumnText cut the original text to fit
> inside
> > the given Rectangle.
> >
> >
> > Any idea?????
> 
> Well, ColumnText behaves exactly the way you need it to behave,
> but I think you've made a mistake when defining the coordinates:
> 
>  > ct.SetSimpleColumn(r.Left, r.Top , r.Left +
>  > r.Width,r.Top - r.Height,pdfFormat.Leading,pdfFormat.Alignment);
> 
> -----------------------------------------------------------------------
> -------
> This SF.net email is sponsored by Sprint
> What will you do first with EVO, the first 4G phone?
> Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first
> _______________________________________________
> iText-questions mailing list
> iText-questions@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/itext-questions
> 
> Buy the iText book: http://www.itextpdf.com/book/
> 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/


------------------------------------------------------------------------------
This SF.net email is sponsored by Sprint
What will you do first with EVO, the first 4G phone?
Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first
_______________________________________________
iText-questions mailing list
iText-questions@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/itext-questions

Buy the iText book: http://www.itextpdf.com/book/
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