iTextSharp table.SpacingBefore not not working

我有一张桌子,我试图从pdf文档的上边缘向下约20/30个浮点(f)。 我想稍微向下空间的原因是因为我的pdf文档边缘有一个矩形边框。

PdfPTable table = new PdfPTable(1); table.SpacingBefore = 20f; table.SpacingAfter = 20f; table.TotalWidth = 700f; table.LockedWidth = true; 

table.SpacingAfter工作得很好但是table.SpacingBefore不会,我的桌子只是坐在上边缘,根本不会空间/填充。

看看这里的答案 ,如果一个表作为文档中的第一项插入,那么SpacingBefore被忽略,这是设计的。 根据post,解决方案是添加一个零段前导的空段落。