1. Help Center
  2. Document Generation for Mendix

How to render an image from the Mendix application to the generated document

One of the methods is to convert the image to a base64 string after the retrieve. We recommend using the java action (Base64EncodeFile) from the Community Commons module. The return variable can be used as a value of an attribute that will be used for a merge field. Your merge field should look like this «Image:Fieldname». The microflow should look something like:

Another method is to use the ‘Alias: _Image_’. For this method you will need to refresh your MXReflex with the module System checked. The microflow that needs to be used in the table should look something like this:

The Fieldname should be set as _Image_ with as selected X path ‘Contents’. The Mergefield should look like «Image:_Image_».