再次出现转换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;
}
} 回复 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);
好的,谢谢 回复 3楼hptj的帖子
不客气,有问题欢迎开新帖提问。
页:
[1]