我在C#中使用Novacode DocX.使用方法InsertSectionPageBreak().但它不保存默认页面的参数.例如,页面应采用横向格式.使用InsertSectionPageBreak()格式更改书籍时.我需要每个表都在横向格式的每个页面上.
using (DocX doc = DocX.Create(fileName))
{
doc.PageLayout.Orientation = Orientation.Landscape;
var table = doc.AddTable(12, 2);
doc.InsertTable(table);
doc.InsertSectionPageBreak();
}
Run Code Online (Sandbox Code Playgroud)
而不是使用的InsertSectionPageBreak的方法DocX类,使用InsertPageBreakAfterSelf了的Table类.
doc.InsertTable(table).InsertPageBreakAfterSelf();
Run Code Online (Sandbox Code Playgroud)
它应该保持上一页的风格.
| 归档时间: |
|
| 查看次数: |
2690 次 |
| 最近记录: |