hptj 发表于 2013-11-28 16:26:00

生成PDF后原SAF文件中页眉的表格边框没有了

iceman 发表于 2013-11-28 18:25:00

回复 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;
                }
            }
      }

hptj 发表于 2013-11-29 09:13:00

Nice work,Thanks.

iceman 发表于 2013-11-29 10:07:00

回复 3楼hptj的帖子

不客气,有问题欢迎开新帖提问。
页: [1]
查看完整版本: 生成PDF后原SAF文件中页眉的表格边框没有了