I am using DocX Reference and there is problem in generating image in the header ..
how to add Image Header??
// Create the document in memory:
var doc = DocX.Create(fileName);
using (MemoryStream ms = new MemoryStream())
{
//if(Branch=="SFA"|Branch=="SSA")
//System.Drawing.Image myImg =Properties.Resources.SerbaAntik;
//if(Branch=="SBA"|Branch=="SMA")
//System.Drawing.Image myImg = Properties.Resources.Sarana;
//if(Branch=="SPA"|Branch=="SSG")
System.Drawing.Image myImg = Properties.Resources.Kharisma;
myImg.Save(ms, myImg.RawFormat);
ms.Seek(0, SeekOrigin.Begin);
Novacode.Image img = doc.AddImage(ms);
Picture pic = img.CreatePicture();
//Paragraph phead = doc.InsertParagraph();
doc.AddHeaders();
Header H = doc.Headers.first;
Paragraph Phead = H.Paragraphs[0];
Phead.InsertPicture(pic, 0);
//phead.AppendPicture(pic);
doc.InsertParagraph(HeadTxt, false, HeadStyle);
doc.InsertParagraph(para1, false, ParaStyle);
doc.InsertParagraph(para2, false, ParaStyle);
doc.InsertParagraph(para3, false, ParaStyle);
// Save to the output directory:
doc.Save();
// Open in Word:
Process.Start("WINWORD.EXE", fileName);
}
}