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
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