I\'m trying to add a table to a document using iTextSharp. Here is an example:
Document document = new Document(PageSize.LETTER,72, 72, 72, 72);
PdfWriter writer
The WidthPercentage property is no longer available in iText7. Use the following instead
table.SetWidth(new UnitValue(UnitValue.PERCENT, 100));
In Java table.setWidthPercentage(100);
Works in 5.5.8 version
In iTextSharp latest version (5.0.4) the PdfPTable
has a WidthPercentage
property.
To set a static value the property is TotalWidth
.
Users can also set table width by Percentage.
t.WidthPercentage = 100f;
Figured it out. Apparently table.Width
is a percent and not the width in pixels. So using:
table.Width = 100;
Worked like a charm.