生成PDF后原SAF文件中页眉的表格边框没有了
回复 1楼hptj的帖子需要设置 Border 的宽度才能导出,代码如下:
private void PrehandleHeader()
{
HeaderFooter header = _currentSection.HeadersAndFooters.GetItem(TXTextControl.HeaderFooterType.Header);
if (header != null)
{
header.Activate();
header.Selection = new Selection(0, -1);
header.Selection.FontName = _fontName;
foreach (Table table in tc.Tables)
{
foreach (TableCell cell in table.Cells)
{
tc.Selection.Start = cell.Start;
tc.Selection.Length = cell.Length;
tc.Selection.FontName = _fontName;
tc.Selection.Length = 0;
cell.CellFormat.BottomBorderWidth = 1;
cell.CellFormat.LeftBorderWidth = 1;
cell.CellFormat.RightBorderWidth = 1;
cell.CellFormat.TopBorderWidth = 1;
}
}
header.Deactivate();
}
}
private void PrehandleTable()
{
foreach (Table table in tc.Tables)
{
foreach (TableCell cell in table.Cells)
{
tc.Selection.Start = cell.Start;
tc.Selection.Length = cell.Length;
tc.Selection.FontName = _fontName;
tc.Selection.Length = 0;
cell.CellFormat.BottomBorderWidth = 1;
cell.CellFormat.LeftBorderWidth = 1;
cell.CellFormat.RightBorderWidth = 1;
cell.CellFormat.TopBorderWidth = 1;
}
}
}
Nice work,Thanks. 回复 3楼hptj的帖子
不客气,有问题欢迎开新帖提问。
页:
[1]