apurvaojas / docx-merger

Javascript Library for Merging Docx file in NodeJS and Browser Environment.
Apache License 2.0
36 stars 39 forks source link

Corrupt docx #48

Open pyonic opened 2 years ago

pyonic commented 2 years ago

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); }); });

abhinovpankaj commented 1 year ago

Getting same but the file opens in MS Word on mac

SPFxAppDev commented 9 months ago

@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