【发布时间】:2017-01-19 13:07:43
【问题描述】:
我在 .Net 中使用 Aspose.Words,我需要使用 Aspose.Words 设置每一侧的页边距、页面方向和页眉页脚距离?
【问题讨论】:
标签: aspose aspose.words
我在 .Net 中使用 Aspose.Words,我需要使用 Aspose.Words 设置每一侧的页边距、页面方向和页眉页脚距离?
【问题讨论】:
标签: aspose aspose.words
您可以通过不同的方式为 Word 文档设置页边距。但以下是最简单的方法:
Document() doc = new Document();
DocumentBuilder(doc) builder = new DocumentBuilder(doc)
{
PageSetup =
{
Orientation = Word.Orientation.Portrait,
PaperSize = Word.PaperSize.Letter,
LeftMargin = 72.0,
RightMargin = 72.0,
TopMargin = 72.0,
BottomMargin = 72.0
},
};
【讨论】: