Images in DOCX Template

Hi @Oleg_Tsurkan
any idea why image isnt working? I have a very basic template with only one attribute in it as below

Hello test, simple template
{{yourImageVariable}:image}

I am passing JSON as below

However final converted word doc is not rendering image and is rather display base64 string.

Hello @Abbas_Khan,

The problem might be in the base64 code. Could you please make sure that it is working, you can use this service to do that.

Hi @Oleg_Tsurkan
It works on image converter however in Plumsail call it does not. Can you kindly have a look at the attached sample?test image plumsail.txt (6.0 KB)

Hello @Abbas_Khan,

We are sorry for the inconvenience, please try to use a new tag: {{yourImageVariable}:picture}

Hi, the image embedding works fine for me however the images are quite large and overflowing the areas I want to display them in my document. Is it possible to define the size of the image ? and constrain the proportions ?

Thanks

Hi, @Raphilass.

You can constrain the size of the image by creating the table and inserting it into a cell. So the cell size will predefine the size of the image.

Best regards, Kirill Shaklein

1 Like

Hi @kirill_sh,
I am doing this, but the image is bleeding out of the cell that I have added the tag in the screen shot attached I have a single cell table - about half a page width with the tag referenced as {{signatureImage}:picture}.

Running the flow and merging the Base64 String with the template gives an image which is nearly the full page width regardless of the width of the table cell it is contained in.

Any ideas ? Thanks

Hi, @Raphilass.

Please go to table properties and turn off ‘automatic resizing’ option:
image

Best regards, Kirill Shaklein.

Hi @kirill_sh,

I had tried that, in fact I tried changing a few settings on the table, column, row and cell. I have attached the resultant file, with the resize option disable and the width of the cell fixed (Top Example) and it simply hides most of the image rather than resizing the image.

I appreciate your help, any further ideas would also be appreciated.

Thanks
Phil

TestImageMerge.docx (58.5 KB)

Hi, @Raphilass.

Yes, preserving the sizes of the table you can’t simply change the size of an image, the simplest option here is to adjust it after pasting.

Best regards, Kirill Shaklein.

Hi @kirill_sh

Thanks,

so there is no way to do this automatically from data generated in a Microsoft flow ? the image would need to be resized manually after the document is generated ?

Thanks
Phil

Hi, Is that image from the peninput control? how did you send it over to the document?

Hi @Petr, is there meanwhile an option to insert pictures in a DOCX document with defined dimensions? I've seen that there is a picture value formatter (https://plumsail.com/docs/documents/v1.x/document-generation/common-docx-xlsx/formatters.html?highlight=picture#picture), but unfortunately I can only give the picture a fixed height and width without a dynamic aspect ratio. Do you have any idea for this requirement?

Hello @phil,

Unfortunately, at the moment you can only define the static dimensions. We're working on implementing the dynamic aspect ratio.

Best regards,
Petr Bushuev
Plumsail team

Dear @Petr

Thanks for your feedback. Do you have any idea when this will be available?

Best regards
Phil

Hello @phil,

There is not due date yet, but probably next 1-2 months. We'll post new options in the formatter description once it's available.

Best regards,
:Petr Bushuev
Plumsail team

Hi,

Is it possible to have repeating rows for images? I.e. I have a dynamic set of rows with images in one column.

Hi @mtzawcoe,

Yes, you can insert the images the same way as any text. We have an example with text, but you can use it with images as well.

Best Regards,
Petr Bushuev
Plumsail team

I know {{base64string:picture}} is for a single image. What's the {{}} for repeating images?

Hello @wheatbarley36,

To insert an image you can use the picture formatter.

You can repeat some sections of a document. For example, add the picture tag to a dynamic table.

If you struggle with some scenario, please share you template, template data (JSON) and an expected result at support@plumsail.com. We'll review the case and advise.

Best regards,
Petr
Plumsail team