Free Support Forum -

HeaderFooterType.Footer[Anything] writes to the header instead

I’m trying to insert an image into the footer following this example and no matter what I try (.FooterFirst or .FooterEven), the image always ends up in the header:

DocumentBuilder builder = new DocumentBuilder(doc);

string imageFileName = “test.jpg”;
builder.InsertImage(imageFileName, RelativeHorizontalPosition.Page, 20.5, RelativeVerticalPosition.Page, 25.5, 40, 50, WrapType.None);

I even tried this in a fresh document and the image still ends up in the header. I can also tell that it’s being added to the header (and not the footer but with a large offset) because the rest of my header gets shifted down with WrapType.Inline, for example, and the footer stays unaffected).

The version of the Aspose.Words.dll that I’m using is

Is this a bug?

Hi Rainier,

Relative positions are changing the position of the image. You can use the following InsertImage overload to keep the image inside the footer


or change the relative positions e.g.

builder.InsertImage(imageFileName, RelativeHorizontalPosition.Character, 10, RelativeVerticalPosition.Paragraph, 10, 50, 50, WrapType.Through);

Best Regards,