user1526912
user1526912

Reputation: 17220

How to prevent MigraDoc header from repeating on additional new pages

Is there a way not to repeat a Migradoc header on every single page?

In my program I add an image to the header of my document as:

    Section section = document.AddSection();
    // Put a logo in the header
    Image image = section.Headers.Primary.AddImage(@"C:\img\SmallLogo.png");

I would like the image to only appear on the first page of my document. However when the document spans multiple pages the image is added at the top of every single page.

How can I only add the image to the first page?

Upvotes: 3

Views: 1358

Answers (1)

Header and Footer will be repeated on all pages of the section. It's a feature, not a bug.

To have the image only on the first page, you can use a "workaround" by setting a different header for the first page.

But IMHO the cleanest solution would be adding the image to the first page and not the header. This way it will only show once - on the first page where you want to have it.

BTW: Images are shapes and can be positioned anywhere on the page.

Upvotes: 3

Related Questions