I am creating a PDF programmatically using iTextSharp and generating a PdfPTable.
In some of the cells I need to have a hyperlink.
Without a hyperlink I can align the text in the cell horizontally and vertically, however when I add in the chunk which contain my hyperlink, the cell looses its alignment property.
Here is my code...
var webAddress = new Chunk(row["product_code"].ToString(), linkFont);
webAddress.SetAnchor(row["url"].ToString());
PdfPCell ProductCodeCell = new PdfPCell();
ProductCodeCell.AddElement(webAddress);
ProductCodeCell.VerticalAlignment = Element.ALIGN_MIDDLE;
ProductCodeCell.HorizontalAlignment = Element.ALIGN_CENTER;
ProductCodeCell.Padding = 3f;
table.AddCell(ProductCodeCell);
Can anyone help me realign the link?
Many thanks.