I am using iText 7 for creating a table inside the PDF file. I have successfully created the table but the table's bottom border is not being drawn.
Screenshot of the Result:
My Code:
private void Convert()
{
String dest = "D:/addingTable.pdf";
var table = new Table(1, true);
Border b = new SolidBorder(ColorConstants.RED, 5);
table.SetBorder(b);
using (var writer = new PdfWriter(dest))
{
using (var pdf = new PdfDocument(writer))
{
var doc = new Document(pdf);
var name = new Paragraph("Hello World!").SetFontColor(ColorConstants.BLUE).SetTextAlignment(iText.Layout.Properties.TextAlignment.CENTER).SetFontSize(13);
table.AddCell(new Cell().Add(name));
doc.Add(table);
}
}
Process.Start(dest);
}