Skip to content

[Q] Does Streaming XLSX Writer support addImage()? #2918

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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
tinhktc opened this issue Apr 16, 2025 · 0 comments
Open

[Q] Does Streaming XLSX Writer support addImage()? #2918

tinhktc opened this issue Apr 16, 2025 · 0 comments

Comments

@tinhktc
Copy link

tinhktc commented Apr 16, 2025

💬 Questions and Help

Hi, I’m currently using exceljs for generating reports in both normal and large-scale datasets.

I understand that WorkbookWriter (Streaming XLSX Writer) is designed for memory efficiency by writing rows directly to disk. I’ve successfully used addRow().commit() for writing large datasets.

However, I need clarification regarding image support:

❓ Can workbook.addImage() and worksheet.addImage() be used with Excel.stream.xlsx.WorkbookWriter?

When I attempt the following with streaming mode:

const workbook = new Excel.stream.xlsx.WorkbookWriter({ filename: 'output.xlsx' });
const sheet = workbook.addWorksheet('Example');

const imgId = workbook.addImage({
  filename: './image.jpg',
  extension: 'jpeg'
});
sheet.addImage(imgId, 'B2:D10');

I get the following error:

TypeError: sheet.addImage is not a function

Could you confirm whether this feature is supported or planned for future versions?

If not, are there any recommended workarounds (e.g., post-processing or hybrid rendering)?

Thanks in advance!

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

1 participant