如何在itextsharp pdf创建中设置单元格宽度
如何使用c#在itextsharp pdf cell ceration中设置单元格宽度和高度。 我只是用
cell.width = 200f;
但它应该显示错误消息。
宽度无法设定。
我该怎么办?..
http://indaravind.blogspot.in/2009/02/itextsharp-table-column-width.html
VB:
Dim intTblWidth() As Integer = {12, 10, 26, 10}
C#:
int[] intTblWidth = { 12, 10, 26, 10 };
您没有设置单元格的宽度。
你应该设置列的宽度。 你可以通过在表对象上应用它们来做到这一点:
float[] widths = new float[] { 1f, 2f }; table.SetWidths(widths);
Neha的答案是设置表格对象的宽度
更多参考资料: http : //www.mikesdotnetting.com/Article/86/iTextSharp-Introducing-Tables
cell.width = 200f;
你必须把大写W放在宽度正确的是cell.Width = 200f;