hptj 发表于 2013-11-27 15:52:00

再次出现转换PDF小方框

这是原始文件,我使用了
            foreach (Table table in textControl1.Tables)
            {
                foreach (TableCell cell in table.Cells)
                {
                  textControl1.Selection.Start = cell.Start;
                  textControl1.Selection.Length = cell.Length;
                  textControl1.Selection.FontName = "宋体";
                  textControl1.Selection.Length = 0;
                }
            }

iceman 发表于 2013-11-27 16:56:00

回复 1楼hptj的帖子

需要使用 hd.Deactivate() 切换操作区域到普通文本区域,设置方式如下:

            TXTextControl.Section currentSection = textControl1.Sections.GetItem();

            HeaderFooter hd = currentSection.HeadersAndFooters.GetItem(TXTextControl.HeaderFooterType.Header);
            hd.Activate();
            hd.Selection = new Selection(0, -1);
            hd.Selection.FontName = "宋体";
            hd.Deactivate();

            foreach (Table table in textControl1.Tables)
            {
                foreach (TableCell cell in table.Cells)
                {
                  textControl1.Selection.Start = cell.Start;
                  textControl1.Selection.Length = cell.Length;
                  textControl1.Selection.FontName = "宋体";
                  textControl1.Selection.Length = 0;
                }
            }

            this.textControl1.Save("demo1.pdf", TXTextControl.StreamType.AdobePDF);

hptj 发表于 2013-11-27 20:04:00

好的,谢谢

iceman 发表于 2013-11-28 09:11:00

回复 3楼hptj的帖子

不客气,有问题欢迎开新帖提问。
页: [1]
查看完整版本: 再次出现转换PDF小方框