Articles in this section

How to set the image header of a document

About this article

This article explains what the image header setting is and provide examples of how it can be used with the binding syntax in smart templates.  

 

Prerequisites

 

 

What is the image header setting? 

The image header allows setting the image meant to appear in the header of a Word document, typically used for logos on company letterhead.  The image header can be set dynamically by utilizing the binding syntax

 

 
  • The image header setting is only available in Word and is only supported with files that will be stored Document Library.

 

How to set the image header in a smart document

When building the template settings and properties, the Image Header setting can be utilized to set the document header for the smart template. Setting the Image Header setting can be achieved by following these steps: 

  1. In the Template Designer, navigate to the Advanced tab
  2. Click Add property 
  3. Select Image Header in the Type dropdown
  4. Fill in the following fields
  • Image: the binding to the desired image, e.g. {{UserProfile.Office.Logo.Image}}
  • Shape Name: the name for the image header, e.g. 'MyLogo'. Multiple image headers can be created each using a unique name
  • Width/Height: the width and height of the image
    • Static: enter a value in centimeters like "2.5 cm" 
    • Dynamic: enter the desired binding to retrieve the expected value
 
  • If only the Width or Height is set, the image will be displayed in the set width or height, maintaining the aspect ratio.
  • NamedSections: the section(s) in which the image will be shown
    • Show the image in all sections: {{NamedSections.All}} 
    • Show the image in section 1:{{NamedSections.First}}
    • Show the image in the last section:{{NamedSections.Last}}
 
  • NamedSections will only work if all sections (after section 1) do not have the Link to Previous (option in the header) enabled
  • {{NamedSections.First}} will not work if the Different First Page (option in the header) is enabled.
  • NamedPages: the page(s) on which the image will be shown
    • Show the image based on the Header & Footer settings from Word: {{NamedPages.Default}} 
    • Show the image on the first page:{{NamedPages.First}}
    • Show the image on odd pages:{{NamedPages.Odd}}
    • Show the image on even pages:{{NamedPages.Even}}
    • Show the image on all pages no matter which settings are set in the Header & Footer from Word:{{NamedPages.All}}
 
  • {{NamedPages.First}} and {{NamedPages.Default}} will only work if the Different First Page (option in the header) is enabled.
  • {{NamedPages.Odd}} and {{NamedPages.Even}} will only work if the Different Odd & Even (option in the header) is enabled.
  • NumberedSections (List): specify the specific sections in which the image will be shown
  • LeftOffset: the offset between the left side of the page and the image
    • Static: enter a value in centimeters like "2.5 cm" 
    • Dynamic: enter the desired binding to retrieve the expected value
  • Horizontal Relative Position
    • Position of the image to the right from the margin: {{HorizontalRelativePosition.Margin}}
    • Position of the image from the left side of the page: {{HorizontalRelativePosition.Page}}
    • Position of the image to the right of the column: {{HorizontalRelativePosition.Column}}
    • Position of the image to the right of the character: {{HorizontalRelativePosition.Character}}
    • Position of the image to the right from the left margin: {{HorizontalRelativePosition.LeftMargin}}
    • Position of the image to the right from the right margin: {{HorizontalRelativePosition.RightMargin}}
    • Position of the image to the right from the inside margin: {{HorizontalRelativePosition.InsideMargin}}
    •  Position of the image to the right from the outside margin: {{HorizontalRelativePosition.OutsideMargin}}
  • Horizontal Alignment
    • Show the image horizontally to the left of the page: {{HorizontalAlignment.Left}}
    • Show the image horizontally to the right of the page: {{HorizontalAlignment.Right}}
    • Show the image horizontally in the center of the page: {{HorizontalAlignment.Center}}
    • Show the image horizontally to the right of the inside margin: {{HorizontalAlignment.Inside}}
    •  Show the image horizontally to the right of the outside margin: {{HorizontalAlignment.Outside}}
  • TopOffset: the offset between the top of the page and the image
    • Static: enter a value in centimeters like "2.5 cm" 
    • Dynamic: enter the desired binding to retrieve the expected value
  • Vertical Relative Position
    • Position of the image below the margin: {{VerticalRelativePosition.Margin}}:
    • Position of the image from the top of the page: {{VerticalRelativePosition.Page}}
    • Position of the image below the paragraph: {{VerticalRelativePosition.Paragraph}}
    • Position of the image below the line: {{VerticalRelativePosition.Line}}
    • Position of the image below the top margin: {{VerticalRelativePosition.TopMargin}}
    • Position of the image below the bottom margin: {{VerticalRelativePosition.BottomMargin}}
    • Position of the image below the inside margin: {{VerticalRelativePosition.InsideMargin}}
    •  Position of the image below the outside margin: {{VerticalRelativePosition.OutsideMargin}}
  • Vertical Alignment
    • Show the image vertically to the top of the page: {{VerticalAlignment.Top}}
    • Show the image vertically to the bottom of the page: {{VerticalAlignment.Bottom}}
    • Show the image vertically in the center of the page: {{VerticalAlignment.Center}}
    • Show the image vertically to the right of the inside margin: {{VerticalAlignment.Inside}}
    •  Show the image vertically to the right of the outside margin: {{VerticalAlignment.Outside}}
  • Image Text Wrapping
    •  The header contains text then the image is shown in front of the text: {{ImageTextWrapping.InFrontOfText}}
    • The header contains text then the image is shown behind the text: {{ImageTextWrapping.BehindText}}
  • Rotation
    • The image is rotated 90 degrees to the right: {{Rotation.Clockwise90Degrees}}
    • The image is rotated 180 degrees: {{Rotation.Clockwise180Degrees}}}
    • The image is rotated 90 degrees to the left: {{Rotation.Counterclockwise90Degrees}}
  • Color: specify the color transformation applied to an image
    • Default color transformation: {{ColorType.Automatic}}:
    • Grayscale transformation: {{ColorType.Grayscale}}
    • Black and white transformation: {{ColorType.BlackWhite}}
    • Mixed transformation: {{ColorType.Mixed}}
  1. Optionally, set an additional option to the setting
  2. Click Add to document

 

Image_header.gif

 

 
  • TopOffset and LeftOffsetdepend on each other and will only work as expected if both are set.
  • If TopOffset is used together with Vertical Relative Position, the actual position will be the addition of both fields TopOffset + Vertical Relative Position.
  • If LeftOffset is used together with Horizontal Relative Position, the actual position will be the addition of both fields TopOffset + Horizontal Relative Position.
  • NamedSections, NamedPages, and NumberedSections shouldn't be used at the same time as it could lead to unexpected behaviors.
  • Using Vertical Relative Position with Vertical Alignment or Horizontal Relative Position with Horizontal Alignment is not recommended as it could lead to unexpected behaviors.

 

Image header setting examples

 

Example 1

Using the Image Header setting together with the IfElse() function in the Image field of the Image Header setting to display the Office logo based on the "IncludeLogo" checkbox originating from the response form.

The image is retrieved from the LogoInsertion data source, with a binding like {{UserProfile.Office.Logo.Image}}. 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 TypeImage! In the data source leave the column empty. The result looks like this:

logoinsertion_noimage.png

 

Now in the Image HeaderImagefield replace the binding {{UserProfile.Office.Logo.Image}} with this binding: {{IfElse(Form.IncludeLogo, UserProfile.Office.Logo.Image, UserProfile.Office.Logo.NoImage)}}.

  • If the "IncludeLogo" is checked, then the image is retrieved from the 'Image' column.
  • If the "IncludeLogo" is not checked, the image would be retrieved from the 'NoImage' column, but since this column contains no images, nothing is returned!

 

Binding {{IfElse(Form.IncludeLogo, UserProfile.Office.Logo.Image, UserProfile.Office.Logo.NoImage)}}
Input Form.IncludeLogo = "☑" Form.IncludeLogo = "☐"
Output Logo is inserted Logo is not inserted

 

 

Example 2

Using the Image Header setting together with the IfElse() function in the Image field of the Image Header setting to display the Office logo based on the "ShowLogo" dropdown originating from the response form.

For this example configure the 'LogoInsertion' data source the same way as shown in example 1.

  • If the "ShowLogo" answer is "Yes", insert the image located in the "LogoColor" of the "Office" data source
  • If the "ShowLogo" answer is  anything else than "Yes", insert the image located in the "NoLogo" of the "Office" data source, note that this column doesn't contain any image purposefully so the logo will not be inserted
Binding {{IfElse(Equals(Form.ShowLogo.Name, "Yes"), UserProfile.Office.Logo.Image, UserProfile.Office.Logo.NoImage)}}
Input Form.ShowLogo.Name= "Yes" Form.ShowLogo.Name= "No"
Output Logo is inserted Logo is not inserted

 

 

Related articles

 

 

images image header
Was this article helpful?
0 out of 0 found this helpful

Comments

0 comments

Article is closed for comments.