Picture in Word

Just like text, in some cases you might want to have pictures in your documents based on certain conditions. In the Studio, this can be done by making use of the picture fragment functionality. First, add any pictures you want to have in your Word template. Then, by making use of the Picture fragment you can replace the pictures in Word depending on the rules you make in your model. Below, an example is geven , based on the Word template presented in the document assembly intro.

The first step is to give the image a title. This is done so you can refer to it. By selecting the properties of the picture in Word, you can add a title. In English, right-click the image and select Format picture, in Dutch, select Afbeelding opmaken. Then, navigate to the correct tab and change the title:

Adding a title
Adding a title

We have called the picture “berkeley_bridge_logo”, but you can use any name. Just make sure it is a clear name. If you have added this document to your model, you can go to Layout > Picture fragment. This opens the following dialog;

Picture fragment dialog
Picture fragment dialog

In the condition field you can add a condition like you normally do. If you don’t know how to use conditions, please take a look at the documentation on conditions.

In ‘Existing picture in document’ there is a drop-down menu. If you open this menu, the Studio will look at all the documents that are created by the model and search them for pictures. If the picture has a title, it will show it, otherwise it shows just the (file)name of the picture. In this example, ‘employee female’ is found in a document called ‘arbeidsovereenkomst.docx’.

In the drop-down ‘Replace with this picture’, the first option is <delete picture>. This deletes the image from the document if the condition is empty or met.

If you want to replace the picture, you can press the ‘…’ button, and select a picture from your hard drive. If you do this, the Studio will copy this picture to a sub folder <modelname>_images. The drop-down menu will show all the pictures you have added. If you have selected the picture, just press [OK]. This works just like text fragments, so the picture fragment must be used before you create the document. Again, the replacement will only happen if the condition is empty or met.