Using images in document templates
There are two ways to use images in document templates:
- Statically - images are placed in document templates, and they are displayed in each template-generated document exactly as they were placed in the template.
- Dynamically - images are linked using a File variable, and in each template-generated document the variable is replaced with the image corresponding to the variable at the given time.
To place a dynamic image in a template, you can use a variable with additional parameters or a variable linked to a placeholder image, which determines the size and location of the image in the final document. Both options are outlined below.
Using a variable with additional parameters
In general, to insert an image into a document template, simply add the name of the variable in the desired location (line, cell) of the template, which in each document created will contain the corresponding image file:
The following parameters are used to set the size and position of the image in the final file:
- For MS Word templates, you can explicitly set the size of the inserted image.
Variable syntax: Template:VariableName::SIZE X AXISxSIZE Y AXIS
Example of using the variable with this parameter: Template:Task.File.Employee picture::200x300
- For MS Word templates, you can explicitly select the option to wrap the image with text. The Wrapping parameter of the variable is used in this case:
- Example:
- {{System.File::50x50;wrapping=around frame}}
- {{System.File::50x50;wrapping=before text}}
- {{System.File::50x50;wrapping=up and down}}
- Format used:
- the variable name is added before the "::" separator (two colons);
- 50x50 is the width x height of the image in the template-generated document;
- wrapping - selects the wrapping option.
Please note: in the examples above, two parameters are used at once, separated by a semicolon: the image size and text wrapping around the image.
- For MS Word templates, the MaxHeight and MaxWidth attributes are also available. When one of these attributes is used, the other will be set proportionally to it in the final file.
- Example of using the variable with an additional attribute:
- {{System.File::MaxWidth=150}}
- Result: the image inserted in the resulting document will have a width of 150 pixels and a height adjusted proportionally.
- In MS Excel templates, images by default "fill" the cell that contains the variable, so the size and proportions will be determined by the size of the cell designated for the image. Merged cells can be used.
- To insert an image in its original size, use the "original" attribute. Example of using the variable with this attribute:
- {{Task.File.Employee picture::original}}