Using images in document templates: Difference between revisions

From Planfix
Jump to: navigation, search
No edit summary
No edit summary
Line 5: Line 5:
|description=Using images in document templates
|description=Using images in document templates
}}<div style="background-color:#ffcaca; border: 1px solid #fd9292;padding:10px;">In document templates, it is allowed to use images in the formats: '''BMP''', '''JPG''', '''JPEG''' и '''PNG'''.</div>
}}<div style="background-color:#ffcaca; border: 1px solid #fd9292;padding:10px;">In document templates, it is allowed to use images in the formats: '''BMP''', '''JPG''', '''JPEG''' и '''PNG'''.</div>


There are two ways to use images in [[document templates]]:
There are two ways to use images in [[document templates]]:
Line 25: Line 26:


Variable syntax:
Variable syntax:
{{VariableName::SIZE_X_AXISxSIZE_Y_AXIS}}
::<nowiki>{{VariableName::SIZE_X_AXISxSIZE_Y_AXIS}}</nowiki>


Example of using the variable with this parameter:
Example of using the variable with this parameter:
{{Task.File.Employee picture::200x300}}
::<nowiki>{{Task.File.Employee picture::200x300}}</nowiki>


*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:
*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:
:Example:
::<nowiki>{{System.File::50x50;wrapping=around frame}}</nowiki>
::<nowiki>{{System.File::50x50;wrapping=around frame}}</nowiki>



Revision as of 09:47, 23 August 2022

In document templates, it is allowed to use images in the formats: BMP, JPG, JPEG и PNG.


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: ZRhtiY.png


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:

{{VariableName::SIZE_X_AXISxSIZE_Y_AXIS}}

Example of using the variable with this parameter:

{{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}}


Using a variable linked to a placeholder image