Open
Description
🐛 Bug Report
I tried to use this package to parse data.xlsx and want to get the inline image, but it failed.
Lib version: 4.4.0
Steps To Reproduce
import ExcelJS from 'exceljs';
const { Workbook } = ExcelJS ;
const workbook = new Workbook();
const data = await workbook.xlsx.readFile('data.xlsx');
const worksheet = workbook.worksheets[0];
for (const image of worksheet.getImages()) {
console.log('processing image row', image.range.tl.nativeRow, 'col', image.range.tl.nativeCol, 'imageId', image.imageId);
// fetch the media item with the data (it seems the imageId matches up with m.index?)
const img = workbook.model.media.find(m => m.index === image.imageId);
console.log('found image for imageId', image.imageId, 'extension', img.extension);
// fs.writeFileSync(`${image.range.tl.nativeRow}.${image.range.tl.nativeCol}.${img.name}.${img.extension}`, img.buffer);
}
The expected behaviour:
worksheet.getImages()
should returns the inline images.
Possible solution (optional, but very helpful):
worksheet.getImages()
returns the inline images.worksheet.getCell('C2')
returns the image data.
Metadata
Metadata
Assignees
Labels
No labels