Words Header margins

Received : 2007/06/19 18:04:14
Message : Hello, i am having trouble reducing the margin between a page header and the body text in words. I've tried updating the TopMargin and HeaderDistance within the builder.CurrentSection in both the header section and the first body section. I would appreciate any help. Please email me at nruiz@mdstaff.com

Thanks,
noel


This message was posted using Aspose.Live 2 Forum

HeaderDistance property setes the distance (in points) between the header and the top of the page. TopMargin controls the distance between the body text and the top of the page. If you want to increase the distance between page header and body text you need either decrease HeaderDistance or increase TopMargin or do both of these actions. I've tried it and that works ok in my test.

Here is a sample code:

Document doc = new Document();

DocumentBuilder builder = new DocumentBuilder(doc);

// Increase header to body distance.

PageSetup ps = builder.PageSetup;

ps.HeaderDistance = 20; // default in MS Word is 35.4

ps.TopMargin = 80; // default in MS Word is 56.7

// Write some test text in header and body.

builder.Write("Body");

builder.MoveToHeaderFooter(HeaderFooterType.HeaderPrimary);

builder.Write("Header1");

Please let me know what exactly is the problem that you are experiencing.

Best regards,