I have created a docX using the docX library and have added an image in the header. However when I convert the docX to PDF using the Spire.doc library, the image is lost. Any idea why? Below is my code:
var doc = DocX.Create(fileName);
string url = @"C:\Users\Desktop\Capture.JPG";
Novacode.Image img = doc.AddImage(url);
Picture pic = img.CreatePicture();
doc.AddHeaders();
Header header_default = doc.Headers.odd;
Paragraph p1 = header_default.InsertParagraph();
p1.Append(headerText).Bold().Color(System.Drawing.Color.LightGray).FontSize(20);
p1.AppendPicture(pic);
doc.Save();
Document docS = new Document();
docS.LoadFromFile(fileName);
string pdfPath = @"C:\Users\Documents\toPDF.PDF";
docS.SaveToFile(pdfPath, FileFormat.PDF);