docx-merger icon indicating copy to clipboard operation
docx-merger copied to clipboard

Corrupt docx

Open pyonic opened this issue 2 years ago • 2 comments

Hi, i have several correct documents and on merging it gives bad docx in result, MsWord can not open it const files = paths.map(fpath => { return fs.readFileSync(fpath, 'binary'); }); fileBlob = new docxmerger({}, files); fileBlob.save('nodebuffer',function (data) { fs.writeFileSync("efgrehtjkuyutyrtergef.docx", data, function(err){ console.log('Error: ', err); }); });

pyonic avatar Sep 14 '22 08:09 pyonic

Getting same but the file opens in MS Word on mac

abhinovpankaj avatar Sep 01 '23 11:09 abhinovpankaj

@pyonic @abhinovpankaj since the package has not been updated for more than 7 years and the package has some bugs regarding "corrupt" Word files, I created my own package. This package also has TypeScript support. See here: https://www.npmjs.com/package/@spfxappdev/docxmerger

SPFxAppDev avatar Feb 07 '24 22:02 SPFxAppDev