Aspose.Words - Set Page Borders

Document doc = new Document();
DocumentBuilder builder = new DocumentBuilder(doc);

PageSetup pageSetup = builder.getPageSetup();
pageSetup.setTopMargin(ConvertUtil.inchToPoint(0.5));
pageSetup.setBottomMargin(ConvertUtil.inchToPoint(0.5));
pageSetup.setLeftMargin(ConvertUtil.inchToPoint(0.5));
pageSetup.setRightMargin(ConvertUtil.inchToPoint(0.5));
pageSetup.setHeaderDistance(ConvertUtil.inchToPoint(0.2));
pageSetup.setFooterDistance(ConvertUtil.inchToPoint(0.2));

Download Source Code

For More Examples, Please Visit Aspose Docs

Last edited May 30, 2014 at 5:07 AM by shoaibkhan, version 1