如何转到Novacode Docx的下一页

Маг*_*уан 5 c# novacode-docx

我在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)

Ser*_*hyk 8

而不是使用的InsertSectionPageBreak的方法DocX类,使用InsertPageBreakAfterSelf了的Table类.

doc.InsertTable(table).InsertPageBreakAfterSelf();
Run Code Online (Sandbox Code Playgroud)

它应该保持上一页的风格.