You draw a rectangle as follows:
PdfContentByte cb = writer.DirectContent;
cb.Rectangle(doc.PageSize.Width -90f, 830f, 50f,50f);
cb.Stroke();
This corresponds to this Rectangle:
Rectangle rect = new Rectangle(
doc.PageSize.Width - 90f, 830f,
doc.PageSize.Width - 40f, 880f);
You can add text inside this rectangle as follows:
ColumnText ct = new ColumnText(cb);
ct.SetSimpleColumn(rect);
ct.AddElement(new Paragraph("This is the text added in the rectangle"));
ct.Go();
source
share