facebooktwittermenuarrow-up

GemBox Support Forum

Add picture to header

I would like to add a picture to the header of the document. I am able to add the header and a picture inline, but not able to get the picture in the header.

Hi Brian,

Try this:

var header = new HeaderFooter(document, HeaderFooterType.HeaderDefault);
document.Sections[0].HeadersFooters.Add(header);

var paragraph = new Paragraph(document);
header.Blocks.Add(paragraph);

var picture = new Picture(document, "image.png");
paragraph.Inlines.Add(picture);

Does it solve your issue?

Also, please check the document’s content model diagram.
Let me know if you need anything else.

Regards,
Mario

Worked perfectly. Thank you.