Reputation: 99
I'm using Aspose.Words in .Net and I need to set page margins from each side, page orientation and header footer distance using Aspose.Words?
Upvotes: 1
Views: 2047
Reputation: 194
You can set page margins for Word document in different ways. But below is the easiest way to do this:
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
},
};
Upvotes: 3