Word (Fill) - upload to image

Demonstrate a example for the function b64img()

This example can also be downloaded from the form store https://formexchange.formcycle.eu/formcycle/portal/form-store/public/formstore/index.xhtml.

Search term: ‘Word’

 

To display an image from an upload, the upload must be converted into a Base64 string. The string is then transferred to the Word document and converted back into an image.

 

Therefore, we first need a hidden field in which the Base64 string is stored. This field must be repeatable! In our example, the repeatable hidden element is ‘tfImgBase64StringMultiple’.

 

Prepare the Word document and insert a field/placeholder with the corresponding name. To display the image, the function ‘b64img()’ is required. The placeholder in Word should then be, for example,

tfImgBase64StringMultiple.b64img()

In the workflow

 

1.) Create a loop (list) and select ‘List of attachments’.
2.) Create a ‘Base64 encode’ action in the loop and select the upload element.
3.) Then, also in the loop, create a ‘Change form values’ action and write the Base64 string (return value of the Base64 encode action) into the hidden field ‘tfImgBase64StringMultiple’.

 

The configuration of the ‘Change form value’ action is a little more complicated here. Please refer to the relevant help section.

powered by XIMA® formcycle
all fields marked with a (*) are required and must be filled out