In reference to closed issue #82 and Demo24 which both now work great if I try and use the same functionality in the document Header i get a "This picture can't be displayed"
const table = doc.createTable(1, 1);
table.getCell(1, 0).addContent(new Paragraph("This is am header"));
const image = Media.addImage(doc, "./demo/images/image1.jpeg");
table.getCell(1, 1).addContent(image.Paragraph);

Many thanks, DocX is great by the way thanks for all your work
Thanks for raising this bug!
Same problem here.
Additionally, the header createImage method is more restrictive than paragraph.createImage. It would be great if the first parameter has the same options (not only Buffer) than paragraph. Maybe the bug is in that line.
Did some investigation
I will fix but it will take some time
Basically, when you add an image to the header/footer, it does not create a relationship
I will re-write this with a better "scanning" solution
At the moment, adding table wont add relationships, and .addImage also wont add relationships to header/footer
only .createImage adds relationships.
So, there's 2 bugs actually!
Most helpful comment
Did some investigation
I will fix but it will take some time
Basically, when you add an image to the header/footer, it does not create a relationship
I will re-write this with a better "scanning" solution
At the moment, adding table wont add relationships, and
.addImagealso wont add relationships to header/footeronly
.createImageadds relationships.So, there's 2 bugs actually!