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. You can make a Word document make sure the layout is perfect. Then, by making use of ‘picture fragment’ you can replace the pictures in Word depending on the rules you make in your model.
We will give an example below, based on a Word document and a picture.
In order to be able to select that particular picture, you need to add a title. This is because ‘image1.jpg’ is not an easy way to select the picture if you have a lot of picures in your document. By selecting the properties of the picture in Word, you can add a title. In Dutch, select ‘Afbeelding opmaken’.
We have called the picture ‘employee female’, but you can use any name. Just make sure it is a logical name. If you have added this document to your model, you can go to
Layout > Picture fragment. This opens the following 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.