question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

workbook.addImage is not a function

See original GitHub issue

I have installed latest version of exceljs, however I’m still getting error workbook.addImage is not a function when i’m trying to add any image to the workbook. PS: I have 0.4.10 version

Issue Analytics

  • State:open
  • Created 6 years ago
  • Reactions:1
  • Comments:19 (1 by maintainers)

github_iconTop GitHub Comments

4reactions
ritesh-nitwcommented, Jun 6, 2018

This issue is a major release blocker. Surprised that, its not being addressed… Right now, its impossible to use addImage using the WorkbookWriter. Any workaround mentioned here won’t work.

Guys, do you know any other library that supports all functionality in WorkbookWriter and easy to switch from exceljs(semantically similar)?

4reactions
ishantiwcommented, Jun 14, 2017

Problem is when we create a workbook using writer stream then it doesn’t find function addImage(). However you can also use the following to add an image.

let workbook = Excel.stream.xlsx.WorkbookWriter()
workbook.media.push({
    filename: './Picture1.png',
    extension: 'png',
  })
worksheet.addImage(0, 'B1:E6')
// where 0 is the index of the image you added in workbook, basically its an index of the image you pushed to media array

Otherwise simply use below to create a worksheet and it works, let workbook = new Excel.Workbook()

Read more comments on GitHub >

github_iconTop Results From Across the Web

ExcelJS doesn't add image - Stack Overflow
I'm trying to add an image using exceljs, but when I try to add the image there is an error fs.readFile is not...
Read more >
addImage-methods: Adding images to a worksheet - Rdrr.io
There is an known issue in Apache POI with adding images to xls workbooks. The result of adding images to workbooks that already...
Read more >
R: Adding images to a worksheet - R-Project.org
Adds an image to a worksheet using a named region. Usage. ## S4 method for signature 'workbook' addImage(object, filename, name, originalSize). Arguments ...
Read more >
exceljs/README.md - UNPKG
244, // adjust properties afterwards (not supported by worksheet-writer) ... the image is added to the workbook via the addImage() function which will...
Read more >
u.readFile is not a function at exceljs.min.js:3:449768 Angular ...
arrayBuffer(); const imageId1 = workbook.addImage({ buffer: imageBuffer.data, extension: 'jpg' });. "These ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found