Free Support Forum - aspose.com

Header image problem from Aspose.Word to Aspose.PDF

Header image appears only on every other page in the PDF output.

Due to security, I can't send the sample but here's what I did.

Create a Image:FieldName in a header of a document. At runtime using a DocumentBuilder, insert an image after a MoveToField and save the document as pdf using aspose.Pdf. The resulting Word Document will show the image at the top (header) of every page, but the PDF shows the image on every other page.

Also, is there a way to specify (in %) the width of the image? In Word, the image I'm using uses the whole width of the document, in PDF it uses only about 80%.

I’ll double check why the image appears only on every other page and report back asap.

Do you mean you image in the Word document takes 100% of the whole page width or 100% of the space between left and right margins?

Hi,

I have it working okay in my test.

Please check that in MS Word, in File/Page Setup for your document you have headers and footers settings (on the Layout tab):
Different odd and even
Dirrerent first page

switched OFF.

If that does not help send your documents to word@aspose.com

Image width is now fixed in Aspose.Word 1.7.5, https://forum.aspose.com/t/130011

You need to use latest Aspose.Pdf as well as the image had to be scaled down because Aspose.Pdf did not allow negative margins for images.