Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] addBackgroundImage not working #2728

Open
jerryheir opened this issue Mar 23, 2024 · 1 comment
Open

[BUG] addBackgroundImage not working #2728

jerryheir opened this issue Mar 23, 2024 · 1 comment

Comments

@jerryheir
Copy link

馃悰 Bug Report

addBackgroundImage not working. addImage and eachSheet are working fine. even ws.addImage works fine.

But addBackgroundImage is not working ...

Lib version: X.Y.Z

Steps To Reproduce

    const imageId = workbook.addImage({
      buffer: image as Buffer,
      extension: "png",
    });
    workbook.eachSheet((ws, _sheetId) => {

      ws.addBackgroundImage(imageId);
      
   })

The expected behaviour:

Image to be added to background successfully

"exceljs": "^4.4.0"

node 18.17.1

@ashmitbp99
Copy link

ashmitbp99 commented Mar 27, 2024

+1

Unable to see background image when adding with the following code:

    worksheet.columns = rows[0].map(header => {
      return { header, key: `column${header}`, width: columnWidthMap[header] || columnWidthMap.default }
    })

    worksheet.insertRows(2, rows.slice(1))

    const imageId1 = workbook.addImage({
      filename: 'src/modules/survey/mail_logo.png',
      extension: 'png',
    })

    worksheet.addBackgroundImage(imageId1) // does not work
    return workbook```
    
    
    using 
    exceljs "^4.4.0"
    node v21.6.1
    
    

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants