About this article
This article explains what the page setup setting is and provide examples of how it can be used with the binding syntax in smart templates.
Prerequisites
|
What is the page setup setting?
The page setup allows controlling the settings available in Word in Layout > Page Setup. These settings help adjust the general setup of the document such as the orientation, the margins, the width and height, and more. The Page setup can be set statically by inputting a specific value or dynamically by using the binding syntax.
|
How to set the page setup in a smart document?
When building the template settings and properties, the Page Setup
setting can be used to set the page layout configuration for the smart template. Setting the Page Setup
setting can be achieved by following the steps below:
- In Template Designer, navigate to the Advanced tab.
- Click
Add property
.
- Select
Page Setup
in theType
dropdown.
- Fill in the following fields:
-
Top/Right/Bottom/Left Margin
expected in centimeters. -
Gutter
expected in centimeters. -
GutterPosition
expected to be either {{GutterPosition.Left}} or {{GutterPosition.Top}}. -
Orientation
expected to be either {{Orientation.Portrait}} or {{Orientation.Landscape}}. -
Header/Footer From Edge
expected in centimeters.
-
- Optionally, set an additional option to the setting:
Disable updates
: Disallow the setting from being updated after its generation when edited by the user through the document content updater. This option will not be visible if the document content updater is not enabled on the smart template.
- Click
Add to document
. ThePage Setup
setting will be added to the smart template.
|
Page setup examples
Example 1
Using the Page Setup
setting to statically set a standard A4 page layout.
Top Margin | "2.54 cm" | ||
Right Margin | "2.54 cm" | ||
Bottom Margin |
"2.54 cm" |
||
Left Margin | "2.54 cm" | ||
Gutter | "0 cm" | ||
Gutter Position | {{GutterPosition.Left}} | ||
Orientation | {{Orientation.Portrait}} | ||
Paper Width | "21 cm" | ||
Paper Height | "29.7 cm" | ||
Header From Edge | "1.25 cm" | ||
Footer From Edge | "1.25 cm" |
Example 2
Using the Page Setup
setting to statically set a standard Letter (US) page layout.
Top Margin | "2.54 cm" | ||
Right Margin | "2.54 cm" | ||
Bottom Margin |
"2.54 cm" |
||
Left Margin | "2.54 cm" | ||
Gutter | "0 cm" | ||
Gutter Position | {{GutterPosition.Left}} | ||
Orientation | {{Orientation.Portrait}} | ||
Paper Width | "21.59 cm" | ||
Paper Height | "27.94 cm" | ||
Header From Edge | "1.25 cm" | ||
Footer From Edge | "1.25 cm" |
Example 3
Using the Page Setup
setting to dynamically set the page orientation based on the "Orientation" dropdown question originating from the response form.
- If 'Portrait' is chosen, the width will be set to 21 cm and the height to 29.7 cm.
- If 'Landscape' is chosen, the width will be set to 29.7 cm and the height to 21 cm.
PageSetup data source:
Top Margin | "2.54 cm" | ||
Right Margin | "2.54 cm" | ||
Bottom Margin |
"2.54 cm" |
||
Left Margin | "2.54 cm" | ||
Gutter | "0 cm" | ||
Gutter Position | {{GutterPosition.Left}} | ||
Orientation | {{IfElse(Equals(Form.Orientation.Name, "Portrait"), Orientation.Portrait, Orientation.Landscape)}} | ||
Paper Width | {{Form.Orientation.PaperWidth}} | ||
Paper Height | {{Form.Orientation.PaperHeight}} | ||
Header From Edge | "1.25 cm" | ||
Footer From Edge | "1.25 cm" |
Example 4
You can set up a (blank) template to use a specific page format (like 'A4' or 'Letter') depending on e.g. the location set in the user profile. For example if the office location is in the United States then the page format automatically is set to 'Letter' and when the office location is in The Netherlands the page format is set to 'A4'.
There are different ways to set this up, this is just one example. Follow the steps below:
- Create a data source named 'PageSetup' and add a
PaperWidth
andPaperHeight
column (both of TypeText
). Then add the values as shown below:
- Always use centimeters ("cm") as the unit of measurement.
- With numbers like '29.7' always use a decimal point as divider, not a comma.
- Create a data source named 'Countries', add a
PaperFormat
column of TypeReference
and link it to the Data Source 'PageSetup' created in step 1. The result looks like this:
- Click
Open data source
, then click+ Create
.
- Type the value 'Netherlands' in the
Name
field and select 'A4' in thePaperFormat
dropdown, then clickCreate
:
- Repeat step 4 with the
Name
'United States' andPaperFormat
'Letter'. The result looks like this:
- Create an 'Offices' data source with a
Country
column of TypeReference
and link it to the Data Source 'Countries' created in step 5.
Optionally add columns likeAddress
andCity
. The result looks like this:
- Next, in the User Profile create a
Dropdown
with theName
andLabel
'Location' and link it to theName
column of the 'Offices' data source. The result looks like this:
Optional: After the dropdown is created add the binding{{UserProfile.Location.Name}}
to theProfile summary
field:
- Create a template. On the Advanced tab in Template Designer click
+ Add property
, then in the Type field selectPage Setup
.
- In the field
PaperWidth
type this binding:{{UserProfile.Location.Country.PaperFormat.PaperWidth}}
.
- In the field
PaperHeight
type this binding:{{UserProfile.Location.Country.PaperFormat.PaperHeight}}
.
- The result looks like this:
- In this example only the fields
Paper Width
andPaper Height
are used, but of course you can also create bindings for other fields likeTop Margin
,Left Margin
andOrientation
if you have created columns for these fields in the 'PageSetup' data source from step 1.
- In this example only the fields
- Click
Add to document
.
- Save the template and upload it to the Admin Center, for example as Blank document:
- Now when a user located in the United States creates a blank document then the page format is automatically set to 'Letter':
When a user located in The Netherlands creates it then the page format is automatically set to 'A4':
Example 5
In example 4 the page format is set depending on the location, but it can also be done in a simpler way by asking the user which page format to use.
Setting up the user profile and template works the same as in example 4, therefore a brief explanation in this example.
- Create a data source named 'PageSetup' and add a
PaperWidth
andPaperHeight
column (both of TypeText
). Then add the values as shown below:
- Always use centimeters ("cm") as the unit of measurement.
- With numbers like '29.7' always use a decimal point as divider, not a comma.
- In the User Profile create a
Dropdown
with theName
'PageFormat' andLabel
'Page format' and link it to theName
column of the 'PageSetup' data source.
- Create a template. On the Advanced tab in Template Designer click
+ Add property
, then in the Type field selectPage Setup
.
- In the field
PaperWidth
type this binding:{{UserProfile.PageFormat.PaperWidth}}
.
- In the field
PaperHeight
type this binding:{{UserProfile.PageFormat.PaperHeight}}
.
- Click
Add to document
.
- Save the template and upload it to the Admin Center, for example as Blank document.
- In the user profile the user can choose to use 'Letter or 'A4' as the page format:
- When a user creates a document and in the user profile the page format is set to 'Letter', then this is applied to the document.
If the page format in the user profile is set to 'A4' then that page format is used:
Related articles
Comments
Article is closed for comments.