saveToBase64 corrupting images

Feb 14, 2014 at 3:59 PM
Please help.

I have a really simple example where I am doing the following:
  • read a .docx as base64 (it contains one image)
  • create a OpenXmlPackage
  • save back to Base64
  • write a new file out.
However, the resulting files image is corrupt every time.

var template = fs.readFileSync('templates/content_control_example_1.docx', 'base64');
var doc = new openXml.OpenXmlPackage(template);
var theContent = doc.saveToBase64();
var buffer = new Buffer(theContent, "base64");
fs.writeFileSync("test.docx", buffer);
Is this a known issue?

Sep 11, 2014 at 2:22 PM
Edited Sep 11, 2014 at 2:22 PM
I'm also having this problem. Did you find a solution, or just give up?