Skip to content

[XLSX-Renderer] How to add images in the worksheet? #191

Answered by Siemienik
Jedliu asked this question in Q&A
Discussion options

You must be logged in to vote

Hi @Jedliu
Could I ask you to add the template file which you used?

About images, currently, it is possible to use only static images - it means, that it is able to put an image in a template, and it will be rendered in the output. There is no ImageCell that would put dynamic images.

However, the desired result might be reached in one of two ways:

  1. Simpler, with using postprocessing. As the XLSX-Renderer has ExcelJS output, it is possible to use API to put images where you want.
// render without images:
const workbook = await new Renderer().renderFromFile('./report-template.xlsx', reportData);

// POST-PROCESSING:
// add image @see https://github.com/exceljs/exceljs#add-image-to-workbook

Replies: 2 comments 2 replies

This comment has been hidden.

@Siemienik

This comment has been hidden.

Comment options

You must be logged in to vote
1 reply
@Jedliu
Comment options

Answer selected by Siemienik
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #190 on August 25, 2021 06:49.