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.

Is it not possible to add image using the WorkbookWriter?

See original GitHub issue

Previously I tried using the excel file writing method. Works fine, but as the data grows so does the memory consumption. Hence the changing of writing method to streaming method.

Tried doing this on WorkbookWriter

var sheet = workbook.addWorksheet('Data');
        var base64Data = req.body.img.toString().replace(/^data:image\/png;base64,/, "");
        fs.writeFile('Tagihan/img.png', base64Data, 'base64', function(err) {
            console.log(err);
        })
var img1 = workbook.addImage({
            filename: 'Tagihan/img.png',
            extension: 'png'
        });

        sheet.addImage(img1, 'A1: H25');

got this error

TypeError: workbook.addImage is not a function

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:5
  • Comments:7 (2 by maintainers)

github_iconTop GitHub Comments

2reactions
ritesh-nitwcommented, Apr 3, 2019

Are you planning to support this in future?

0reactions
chdhcommented, Jul 23, 2020

Duplicate of #322 and #351.

Read more comments on GitHub >

github_iconTop Results From Across the Web

writing image to excel with xlsxwriter returns " workbook not ...
The error comes from this line: self.workbook = self.writer.book('Name1'). Book is an object, not a method and it has the following fields ...
Read more >
Insert a picture in Excel for the web - Microsoft Support
Inserting a picture in your worksheet is an easy way to show information or add visual interest. There are three ways to add...
Read more >
@mmcraven/exceljs - npm
Then, using the imageId, the image can be added to the worksheet either as a tiled background or covering a cell range. Note:...
Read more >
The Workbook Class — XlsxWriter Documentation
The Workbook() constructor is used to create a new Excel workbook with a given ... to convert strings to numbers, where possible, using...
Read more >
How to Insert Picture Into a Cell in Excel (a Step-by-Step ...
This could also be useful if you're working with products/SKUs and their images. When you insert an image in Excel, it not linked...
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