Add footer do migradoc document

Posted on 2011-10-14
Last Modified: 2013-12-16

I need to create a document with simple table.
That works fine at all but I like to have a footer there counting the pages, eg.
Page X of Y ...

For the samples I found it looks very simple:
Add a footer and the content for to a section - but my footer will never been shown ...

Any idea what's wrong here?



public class Invoice
    Document document;
    Table table;
    Section section;

    TextMeasurement tm;

    public Invoice()

    public Document CreateDocument(DataTable dt)
        this.document = new Document();
        this.document.Info.Title = "Rechnung";
        this.document.Info.Subject = "";
        this.document.Info.Author = "";

        return this.document;

    void DefineStyles()
        Style style;

        style = this.document.Styles["Normal"];
        style.Font.Name = "Arial";
        style.Font.Size = 7;

        style = this.document.Styles[StyleNames.Footer];
        style.ParagraphFormat.AddTabStop("8cm", TabAlignment.Center);
        style = this.document.Styles.AddStyle("Table", "Normal");
        style.Font.Name = "Arial";
        style.Font.Size = 7;


    void CreatePage()

        section = this.document.AddSection();

        // Create footer
        Paragraph paragraph = section.Footers.Primary.AddParagraph();
        paragraph.AddText("PowerBooks Inc · Sample Street 42 · 56789 Cologne · Germany");
        paragraph.Format.Font.Size = 9;
        paragraph.Format.Alignment = ParagraphAlignment.Center;


Open in new window

Question by:andre72
    LVL 14

    Assisted Solution

    by:Daniel Junges

    Author Comment

    I think this work only for word and does not matter for MigraDoc ...
    LVL 14

    Assisted Solution

    by:Daniel Junges
    ohh sorry, was my mistake...

    i searched and found this

    may be this help you.

    i work only with msword and broffice and not familiar with MigraDoc

    Accepted Solution

    I've given up ...

    Author Closing Comment

    Seems that not so much EE use MigraDoc ...

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Looking for New Ways to Advertise?

    Engage with tech pros in our community with native advertising, as a Vendor Expert, and more.

    Recently while returning home from work my wife (another .NET developer) was murmuring something. On further poking she said that she has been assigned a task where she has to serialize and deserialize objects and she is afraid of serialization. Wha…
    In my previous two articles we discussed Binary Serialization ( and XML Serialization ( In this article we will try to know more about SOAP (Simple Object Acces…
    Need more eyes on your posted question? Go ahead and follow the quick steps in this video to learn how to Request Attention to your question. *Log into your Experts Exchange account *Find the question you want to Request Attention for *Go to the e…
    Hi everyone! This is Experts Exchange customer support.  This quick video will show you how to change your primary email address.  If you have any questions, then please Write a Comment below!

    759 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    11 Experts available now in Live!

    Get 1:1 Help Now