Does DocX support images in headers and footers?

Developer
Jul 20, 2010 at 6:06 PM

As topic says. Does it?

 

With regards,

 

MadBoy

Apr 8, 2011 at 5:31 PM
Edited Apr 8, 2011 at 5:52 PM

same question...Does it? Thanks

ok..it's possible

Header header_default = document.Headers.odd;
header_default.SetDirection(Direction.RightToLeft);
Paragraph p1 = header_default.InsertParagraph();
p1.Direction = Direction.RightToLeft;
 string logoFullPath = System.IO.Path.Combine(TemplateDirectory.FullName, "logo.jpg");
Image img = document.AddImage(logoFullPath);
Picture picture = img.CreatePicture();
p1.AppendPicture(picture);

Coordinator
Apr 17, 2011 at 6:07 PM

MadBoy and ibazar83,

the latest version of DocX should contain fairly complete and robust support for images in Headers and Footers.

Have you found a bug?

Cathal

Developer
Apr 17, 2011 at 6:11 PM

Hello Cathal,

I can't use newest version, nor latest builds since the newest versions have problems generating the documents that used to work (the ones I've emailed to you). So i'm preety much stuck with some 1.0.0.10 build version. I've solved my problem (did workaround the issue with older versions) by using templates with header/footer already inserted and then added text with your library. I'm  not sure if newest versions work since I simply can't use it :-) But I admire your work anyway! This project is one of my favourites and I always tell people to use it around the "web".

With regards,

MadBoy

Coordinator
Apr 18, 2011 at 11:11 AM
Hi MadBoy,

I would really like to fix this issue for you. Nobody sends more people to the DocX homepage than you.
This Friday is a bank holiday, I will try my very best to fix this issue for you before then.

I just searched my gmail and found these two documents 0002.98.docx and 0002.100.docx is this the bug that is causing you problems?
Its great to have the two documents for comparison but can you also provide code that generates the broken document?

I am sorry that this has remained broken for so long,
Cathal
Developer
Apr 18, 2011 at 11:21 AM
Edited Apr 18, 2011 at 1:18 PM

Hello Cathal,

I've sent you the code to your email. Hope it helps you a bit.

With regards,


MadBoy