natergj / excel4node

Node module to allow for easy Excel file creation
MIT License
1.38k stars 215 forks source link

addImage function not writing image / not sending error message #287

Closed ebefarooqui closed 5 years ago

ebefarooqui commented 5 years ago

Currently trying to add an image to my excel sheet using the addImage function. The sheet never gets written nor is an error thrown.

Here's the relevant code snippet:

const wb = new xl.Workbook();
const ws = wb.addWorksheet('title');

ws.addImage({
    path: LOGO_PATH,
    type: 'picture',
    position: {
      type: 'absoluteAnchor',
      x: '1in',
      y: '2in',
    },
  });

wb.write('title.xlsx');

The image is stored in the working directory that this function is called.

I expect either the image to be written or to receive an error but neither occur. Writing simple strings into the cells without the image works: file is created locally for me.

Using excel4node v1.7.2, Microsoft Excel v16.16.9, and Mac OS High Sierra (v10.13.6)

ebefarooqui commented 5 years ago

Pretty new to this package too and wondering how everyone goes about debugging. Adding validation statements?