About this article
Image Header is a document setting that is used for images in the header of a Word document. Typically Image Header is used for logos on company letterhead and is often dynamic by using the binding syntax.
Prerequisites
|
- Open the template in Dynamics Designer (you don’t have to enable the header or footer).
- On the Document tab select
Image Header (Dynamics Templates)
and click the+
button. - The following fields are available:
Image: The binding to an image, e.g. {{UserProfile.Office.Logo.Image}}.
Shape Name: Use any name for the image header, e.g. 'MyLogo'. You can create multiple image headers with a unique name for each image header.
Width: Set the width of the image. You can use a binding like {{UserProfile.Office.Logo.Width}} if you want to retrieve the value from a data source, but you can also enter a value in centimeters like '2.5 cm' (like in the field 'Left Offset' in the image above).
|
Height: Set the height of the image. You can use a binding like {{UserProfile.Office.Logo.Height}} if you want to retrieve the value from a data source, but you can also enter a value in centimeters like '2.5 cm'.
|
Named Sections: These values can be used:
- {{NamedSections.All}}: Image is shown in all sections.
- {{NamedSections.First}}: Image is only shown in section 1.
- {{NamedSections.Last}}: Image is only shown in the last section.
|
Named Pages: These values can be used:
- {{NamedPages.Default}}: Shows the image from page 2 onward.
- {{NamedPages.First}}: Shows the image on the first page.
- {{NamedPages.Odd}}: Shows the image on odd pages.
- {{NamedPages.Even}}: Shows the image on even pages.
- {{NamedPages.All}}: Shows the image on all pages.
|
Numbered Sections (List): Shows the image in specific sections. For example if you want to show the image in sections 2 and 4, click Add value
twice and enter '2' and '4':
|
Left Offset: Show the image x centimeters from the left side of the page (unless the Horizontal Relative Position is set). You can enter a value in centimeters like '2.5 cm' or use a binding like {{UserProfile.Office.Logo.LeftOffset}} if you want to retrieve the value from a data source.
|
Horizontal Relative Position:
- {{HorizontalRelativePosition.Margin}}: Position of the image to the right from the margin.
- {{HorizontalRelativePosition.Page}}: Position of the image from the left side of the page.
- {{HorizontalRelativePosition.Column}}: Position of the image to the right of the column.
- {{HorizontalRelativePosition.Character}}: Position of the image to the right of the character.
- {{HorizontalRelativePosition.LeftMargin}}: Position of the image to the right from the left margin.
- {{HorizontalRelativePosition.RightMargin}}: Position of the image to the right from the right margin.
- {{HorizontalRelativePosition.InsideMargin}}: Position of the image to the right from the inside margin.
- {{HorizontalRelativePosition.OutsideMargin}}: Position of the image to the right from the outside margin.
|
Horizontal Alignment:
- {{HorizontalAlignment.Left}}: Show the image horizontally to the left of the page.
- {{HorizontalAlignment.Right}}: Show the image horizontally to the right of the page.
- {{HorizontalAlignment.Center}}: Show the image horizontally in the center of the page.
- {{HorizontalAlignment.Inside}}: Show the image horizontally to the right of the inside margin.
- {{HorizontalAlignment.Outside}}: Show the image horizontally to the right of the outside margin.
|
Top Offset: Show the image x centimeters from the top of the page (unless the Vertical Relative Position is set). You can enter a value in centimeters like '2.5 cm' or use a binding like {{UserProfile.Office.Logo.TopOffset}} if you want to retrieve the value from a data source.
|
Vertical Relative Position:
- {{VerticalRelativePosition.Margin}}: Position of the image below the margin.
- {{VerticalRelativePosition.Page}}: Position of the image from the top of the page.
- {{VerticalRelativePosition.Paragraph}}: Position of the image below the paragraph.
- {{VerticalRelativePosition.Line}}: Position of the image below the line.
- {{VerticalRelativePosition.TopMargin}}: Position of the image below the top margin.
- {{VerticalRelativePosition.BottomMargin}}: Position of the image below the bottom margin.
- {{VerticalRelativePosition.InsideMargin}}: Position of the image below the inside margin.
- {{VerticalRelativePosition.OutsideMargin}}: Position of the image below the outside margin.
|
Vertical Alignment:
- {{VerticalAlignment.Top}}: Show the image vertically at the top of the page.
- {{VerticalAlignment.Bottom}}: Show the image vertically at the bottom of the page.
- {{VerticalAlignment.Center}}: Show the image vertically in the center of the page.
- {{VerticalAlignment.Inside}}: Show the image vertically inside the page.
- {{VerticalAlignment.Outside}}: Show the image vertically outside the page.
Image Text Wrapping:
- {{ImageTextWrapping.InFrontOfText}}: If the header contains text then the image is shown in front of the text.
- {{ImageTextWrapping.BehindText}}: If the header contains text then the image is shown behind the text.
Rotation:
- {{Rotation.Clockwise90Degrees}}: Image is rotated 90 degrees to the right.
- {{Rotation.Clockwise180Degrees}}: Image is rotated 180 degrees.
- {{Rotation.Counterclockwise90Degrees}}: Image is rotated 90 degrees to the left.
Color:
Specifies the color transformation applied to an image.
- {{ColorType.Automatic}}: Default color transformation (image is shown in default colors).
- {{ColorType.Grayscale}}: Grayscale transformation (image is shown in grayscale).
- {{ColorType.BlackWhite}}: Black and white transformation (image is shown in black and white).
- {{ColorType.Mixed}}: Mixed transformation.
- {{ColorType.Watermark}}: Watermark transformation.
Disable Updates:
If Disable Updates
is checked, no changes will be applied when using document content updater. By default, it's unchecked, allowing updates.
- Click ‘Save’ to save your changes.
|
Example 1
To show/hide an image in general you can use a Group binding combined with a Visibility binding to achieve this, but the Image Header does not provide a Visibility field. However following the steps below, using the IfElse() function, you have the option to show/hide an Image Header image, using a Checkbox.
In the image above (see step 3) the binding {{UserProfile.Office.Logo.Image}} is used.
The image is retrieved from the LogoInsertion data source. Now the first step to add a new schema field (column) to the data source, e.g. 'NoImage' (you can use any name). The new schema field must be of Type Image
! In the data source leave the column empty. The result looks like this:
Now in the Image HeaderImage
field replace the binding {{UserProfile.Office.Logo.Image}} with this binding: {{IfElse(Form.Checkbox, UserProfile.Office.Logo.Image, UserProfile.Office.Logo.NoImage)}}.
If the checkbox is checked, then the image is retrieved from the 'Image' column. If unchecked the image would be retrieved from the 'NoImage' column, but since this column contains no images, nothing is returned!
Binding |
{{IfElse(Form.Checkbox, UserProfile.Office.Logo.Image, UserProfile.Office.Logo.NoImage)}} |
|
Input | Form.Checkbox = "☑" | Form.Checkbox = "☐" |
Output | Image is inserted | Image is not inserted |
Example 2
The same as example 1, but in this example the image is shown/hidden depending on the value of a dropdown form field.
Binding |
{{IfElse(Equals(Form.ShowLogo.Name, "Yes"), UserProfile.Office.Logo.Image, UserProfile.Office.Logo.NoImage)}} |
|
Input | "Yes" | "No" |
Output | Image is inserted | Image is not inserted |
Comments
0 comments
Article is closed for comments.