adding Image doesn't work
See original GitHub issueMy files:
My excel file:
My code
const excel = require('exceljs');
const fs = require('fs');
(async () => {
try {
const wb = new excel.Workbook();
const file = await wb.xlsx.readFile('excel1.xlsx');
const ws = file.getWorksheet('lal'); // sheetname is 'lal'
const imgId = wb.addImage({
buffer: fs.readFileSync('dk2.png'),
extension: 'png'
});
// not work
ws.addBackgroundImage(imgId);
// not work
ws.addImage(imgId, 'I1:I2');
// not work
ws.addImage(imgId, {
tl: { col: 8, row: 2 },
br: { col: 8, row: 2 }
});
console.log('file img', imgId); // id=0
} catch (error) {
console.log('error', error);
}
})();
after running the code , the excel1.xlsx changed nothing, there wasn’t an image in it. and the code didn’t throw any error or warning, could anyone help me? @guyonroche
Issue Analytics
- State:
- Created 6 years ago
- Reactions:1
- Comments:6
Top Results From Across the Web
HTML insert Image doesn't work - Stack Overflow
Right click the broken image and "Open Image in New Tab ", and you'll see the URL of where the image is trying...
Read more >7 Reasons Why Images Are Not Loading on Your Website
7 Reasons Why Images Are Not Loading on Your Website · 1. Incorrect File Paths · 2. Files Names Misspelled · 3. Wrong...
Read more >Troubleshoot issues with Google Images - Google Search Help
Troubleshoot issues with Google Images · Step 1: Try private browsing mode · Step 2: Clear your browser's cache & cookies · Step...
Read more >I can't add an Image - HTML & CSS - SitePoint Forums
I am new to CSS and I am trying to do something simple but for some reason it's not working for me. All...
Read more >How to fix image not showing in an HTML page
How to fix image not showing in an HTML page · Check the src path to of the <img> tag · Check the...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@labs00 I see that you are reading the excel1.xlsx file at the start, but not ‘saving’ it after adding the image. Until you save (using writeFile) the changes will only be in memory
Hello, Nodejs example:
browser example:
getExelBuffer() and then