Image to word document

Hello,

I am trying to add a image (or images) to a word document with the help of the below documentation.
https://plumsail.com/docs/documents/v1.x/document-generation/docx/pictures.html

in word document I have added {{img}:picture}

The flow runs fine but the pictures are not appearing

I am not sure what is wrong please advise

Hello @Rinu,

  • I've just tried to reproduce the issue but inserting a picture works ok for me.

Please check the following

  • Convert the base64 code to image using some online converter. For example, this one

Copy the base64 code from the result of the action

If you can see the decoded image ok, please share the docx template.

Best regards,
Petr
Plumsail team

Thanks Petr, for getting back to me. I was able to get it to work. The issue was I did not use "Create File" action. The decode image is ok. Please see the attached word document as advised
Document.docx (18.3 KB

There are few doubts if you can guide me to I would appreciate it.

  1. How to add multiple images?
    The idea is to create a word file based on the form details, the images comes from multiple attachment from the list item. What I was thinking is to store multiple attachment (images) in to a document library and add it to the word document. This also begs the second question.
  2. How do I resize the image?
    ie to set the image length and width if an image that is to go to the word file.

Hello @Rinu,

  1. You can add multiple images the same way you added one image. For example, you can place the picture tag into a table cell and use a JSON to add multiple images. You can find a similar example of the JSON here.

  2. Picture formatter support resizing. For example, you can specify it this way

{{value}:picture(100,100)}

Please check out the documentation.

Best regards,
Petr
Plumsail team

1 Like