Thanks for the reply. The problem I had using document.Right and document.Left was that it didn't match the current column (e.g. 300 specified by SetSimpleColumn()) width. The document width could be 612, but the current column width is 300, so document.Right would span the page and not the column, resulting in the line spanning the page and not the column.
My workaround is to call a method to keep track of the current column width every time I call SetSimpleColumn so that the PageEvent handler always knows the current "page" (column) width. It would be nice though if I could get the rectangle or document passed into OnGenericTag to represent the actual width of the current column specified by ColumnText. Hope that makes sense. Thanks. -Mitch -----Original Message----- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Bruno Lowagie Sent: Tuesday, March 06, 2007 11:23 AM To: Post all your questions about iText here Subject: Re: [iText-questions] HR Using PageEvent vs DeprecatedGraphic Object Mitch Freed wrote: > And here is a sample CS file. You need some more Go()s and the method getYLine() (or YLine in C#???) See below (and adapt to C#): ColumnText ct = new ColumnText(cb); ct.SetSimpleColumn(document.Left, document.Bottom, 300f, document.Top); Paragraph p =new Paragraph(float.NaN, ""); p.SetAlignment("left"); p.Add(new Chunk("This is some lame text. This is some lame text. This is some lame text. This is some lame text. This is some lame text. This is some lame text. This is some lame text. This is some lame text. This is some lame text. This is some lame text.")); ct.AddElement(p); ct.Go(); cb.SaveState(); cb.SetLineWidth(1f); cb.SetColorStroke(Color.BLACK); cb.MoveTo(document.Left, ct.getYLine()); cb.LineTo(document.Right, ct.getYLine()); cb.Stroke(); cb.RestoreState(); Paragraph p2 = new Paragraph(float.NaN, ""); p2.SetAlignment("left"); p2.Add(new Chunk("This is some more lame text. This is some more lame text. This is some more lame text. This is some more lame text. This is some more lame text. This is some more lame text. This is some more lame text. This is some more lame text.")); ct.AddElement(p2); ct.Go(); br, Bruno ------------------------------------------------------------------------ - Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys-and earn cash http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDE V _______________________________________________ iText-questions mailing list iText-questions@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/itext-questions Buy the iText book: http://itext.ugent.be/itext-in-action/ ------------------------------------------------------------------------- Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys-and earn cash http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV _______________________________________________ iText-questions mailing list iText-questions@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/itext-questions Buy the iText book: http://itext.ugent.be/itext-in-action/