Hi, I must be missing something really obvious, so apologies in advance. I am trying to add a header and a footer to my page, and then some text.
First I do some setup:
Code:
_document = new MigraDoc.DocumentObjectModel.Document();
// Add a single section and set the page size and margin
_section = _document.AddSection();
_section.PageSetup.PageFormat = PageFormat.A4;
_section.PageSetup.TopMargin = Unit.FromCentimeter(1.5);
_section.PageSetup.BottomMargin = Unit.FromCentimeter(1.5);
Header and footer are along these lines:
Code:
var location = _section.Headers.FirstPage;
// Add a paragraph, set the alignment and add the logo
var headerLogo = location.AddParagraph();
headerLogo.Format.Alignment = ParagraphAlignment.Center;
headerLogo.Format.Font.Name = "Century Gothic";
headerLogo.Format.Font.Size = 9;
Then the text is like this:
Code:
var a1 = _section.AddParagraph();
a1.AddText("Address will go here");
So a very simple example. What I am finding is that the "Address will go here" is at the very top of the page, it isn't pushed down below the header. I have tried _section.Elements.AddParagraph too, with no difference.
Also, if I add multiple paragraphs, the text goes all over the footer, rather than a page break being inserted.
As I said, I must be doing something stupid. Pointers welcome. Thanks.