I use js-xlsx as excel parser to generate json array|object, when output the xlsx file using the same data with blob.js and filesaver.js simply follow the way described in the demo. It worked fine but the size of outputs is amazing larger(almost 10 times) than the original one. I tried the csv format, no such fileSize issue, but it will cutdown the flexibility.
I do not know the background exactly, i guess the blob added tons of info. After open and save the xlsx file generated, the size change and shrink reasonable. Is there any way to control or reduce the size when using blob?
It will be very helpful to give some advices. thanks a lot.
jszip has a compression option, js-xlsx just needs to expose it
@ragingpatatot , you mean output the zip file. It's a nice option. I'll try it, and see the result.
Currently the compression write option instructs the zip library to compress files. See https://github.com/SheetJS/js-xlsx/#writing-options.
As an example:
XLSX.writeFile(workbook, 'out.xlsx', {compression:true});
{compression:true} does not seem to do anything. I am reading a 18 KB file and after writing, it keeps becoming 1,1 MB.
Any other suggestions?
Most helpful comment
Currently the
compressionwrite option instructs the zip library to compress files. See https://github.com/SheetJS/js-xlsx/#writing-options.As an example: