guigrpa / docx-templates

Template-based docx report creation

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Images based in FOR cycle

arnamb opened this issue · comments

I'm generating word document, which has several images (quantity of them is not known until last step). Is there any possibility, I could use FOR cycle to generate images?

For example.:

{ FOR image in imagesArray } { INS IMAGE image() } { END-FOR imagesArray }

The imagesArray would look something like this:

[ { image: 'someKindOfBase64Url-2' }, { image: 'someKindOfBase64Url-1 } ]

Yes something like that should be possible, but make sure to read the docs (README) first. Each image should be provided as { width: 6, height: 6, data, extension: '.gif' } and the INS and IMAGE commands should not be combined. You should only use IMAGE for your use case.

Okay, I got it, thanks :) It worked :)

Ok great! I'll close the issue then.