We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Dynamic Image per Page


I want to be able to change an image in the page header - during the merge - and set the image to a different image based on the page number I am on. For example, on page 1, I would insert an absolutely positioned image A.gif, page 2 B.gif, etc.

Is this possible?


Hi Rob,

Thanks for your inquiry. Please note that MS Word document is flow document and does not contain any information about its layout into lines and pages. Therefore, technically there is no “Page” concept in Word document. Pages are created by Microsoft Word on the fly.
Aspose.Words uses our own Rendering Engine to layout documents into pages. Please check using the DocumentLayoutHelper sample from the offline samples pack. This sample demonstrates how to easily work with the layout elements of a document and access the pages, lines, rows, spans etc.

Regarding insertion of different image at each page, you can insert different image at each page of document by inserting image in the header of each section. In this case, you have to insert section break of type NewPage at the end of each page of document.

It would be great if you please share your input word document along with expected output document here. We will then provide you more information on this along with code.