SnapToGrid
ParagraphFormat.SnapToGrid property
指定当前段落在布置段落内容时是否应使用每页文档网格线数设置。
public bool SnapToGrid { get; set; }
例子
展示如何指定每页行数的限制。
Document doc = new Document();
DocumentBuilder builder = new DocumentBuilder(doc);
// 启用间距,然后使用它来设置本节每页的行数。
// 足够大的字体大小会将一些行推到下一页以避免字符重叠。
builder.PageSetup.LayoutMode = SectionLayoutMode.LineGrid;
builder.PageSetup.LinesPerPage = 15;
builder.ParagraphFormat.SnapToGrid = true;
for (int i = 0; i < 30; i++)
builder.Write("Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. ");
doc.Save(ArtifactsDir + "PageSetup.LinesPerPage.docx");
也可以看看
- class ParagraphFormat
- 命名空间 Aspose.Words
- 部件 Aspose.Words