I am merging two Word documents with OpenXML SDK but get a corrupt document when copying an image into a header
问题 I have code which works in all sorts of different situations, including when copying images into the body of the document. The code works when copying (adding) headers and footers from one document to the other, as long as the headers/footers being copied do not contain images. When I copy a header which has an image in it, then the resulting file is corrupt, and when I try to open it with the OpenXML SDK it throws an exception saying "Compressed part has inconsistent data length". I do know