我想获得下面的单元格的高度。如何获取C#中itextSharp表格单元格的高度?
cell_logo
cell_title
cell_version
cell_dateTime
cell_appVersion
但cell_name.Height回报。我怎样才能得到这些细胞的实际高度?
PdfPTable table = new PdfPTable(1);
table.TotalWidth = doc.PageSize.Width - doc.LeftMargin - doc.RightMargin;
table.LockedWidth = true;
PdfPCell cell_logo = new PdfPCell(imgLog);
cell_logo.HorizontalAlignment = 1;
cell_logo.BackgroundColor = new BaseColor(System.Drawing.Color.White);
cell_logo.PaddingBottom = 20;
cell_logo.PaddingTop = 50;
PdfPCell cell_title = new PdfPCell(docName);
cell_title.HorizontalAlignment = 1;
cell_title.BackgroundColor = new BaseColor(System.Drawing.Color.White);
cell_title.PaddingBottom = 50;
PdfPCell cell_versions = new PdfPCell(ssVersions);
cell_versions.BackgroundColor = new BaseColor(System.Drawing.Color.White);
cell_versions.PaddingTop = 5;
cell_versions.PaddingBottom = 5;
PdfPCell cell_dateTime = new PdfPCell(time);
cell_dateTime.BackgroundColor = new BaseColor(System.Drawing.Color.White);
cell_dateTime.PaddingTop = 5;
cell_dateTime.PaddingBottom = 5;
PdfPCell cell_appVersion = new PdfPCell(SSCGVersion);
cell_appVersion.BackgroundColor = new BaseColor(System.Drawing.Color.White);
cell_appVersion.MinimumHeight = doc.PageSize.Height - doc.TopMargin - doc.BottomMargin - cell_logo.Height - cell_title.Height - cell_versions.Height - cell_dateTime.Height;
table.AddCell(cell_logo);
table.AddCell(cell_title);
table.AddCell(cell_versions);
table.AddCell(cell_dateTime);
table.AddCell(cell_appVersion);
doc.Add(table);
其实我想设置表格高度等于页面大小
可能重复[无法正确计算itext PdfPTable/PdfPCell高度](http://stackoverflow.com/questions/24448319/unable-to-calculate-itext-pdfptable-pdfpcell-height-properly)。您需要按照[这些示例](http://developers.itextpdf.com/examples/tables/repeating-rows)中所述的方式询问表格的高度。高度单元本身并不重要;这是单元格所属行的高度。另请参阅[如何使页脚粘到每个pdf页面的底部?](http://developers.itextpdf.com/question/how-make-footer-stick-bottom-every-pdf-page) –