Articles in this section

How to set the page setup of a document

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

 

 
  • The page setup setting is only available in Word and is only supported with files that will be stored in the Document Library.

 

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: 

  1. In Template Designer, navigate to the Advanced tab.

  2. Click Add property.

  3. Select Page Setup in the Type dropdown.

  4. 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.
       
  5. 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.

  6. Click Add to document. The Page Setup setting will be added to the smart template. 

Page_setup.gif

 

 

 

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:

pagesetup.png

 

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:

  1. Create a data source named 'PageSetup' and add a PaperWidth and PaperHeight column (both of Type Text). Then add the values as shown below:

    ps_pagesetup.png

     
    • Always use centimeters ("cm") as the unit of measurement.
    • With numbers like '29.7' always use a decimal point as divider, not a comma.
     
  2. Create a data source named 'Countries', add a PaperFormat column of Type Reference and link it to the Data Source 'PageSetup' created in step 1. The result looks like this:

    ps_countriesschema.png

  3. Click Open data source, then click + Create.

  4. Type the value 'Netherlands' in the Name field and select 'A4' in the PaperFormat dropdown, then click Create:

    ps_createdatasourceitem.gif

  5. Repeat step 4 with the Name 'United States' and PaperFormat 'Letter'. The result looks like this:

    ps_countriesdatasource.png

  6. Create an 'Offices' data source with a Country column of Type Reference and link it to the Data Source 'Countries' created in step 5.
    Optionally add columns like Address and City. The result looks like this:

    ps_offices.png

  7. Next, in the User Profile create a Dropdown with the Name and Label 'Location' and link it to the Name column of the 'Offices' data source. The result looks like this:

    ps_userprofilelocation.png

    Optional: After the dropdown is created add the binding {{UserProfile.Location.Name}} to the Profile summary field:

    ps_userprofilesummary.png

  8. Create a template. On the Advanced tab in Template Designer click + Add property, then in the Type field select Page Setup.

  9. In the field PaperWidth type this binding: {{UserProfile.Location.Country.PaperFormat.PaperWidth}}.

  10. In the field PaperHeight type this binding: {{UserProfile.Location.Country.PaperFormat.PaperHeight}}.

  11. The result looks like this:

    ps_advanced.png

     
    • In this example only the fields Paper Width and Paper Height are used, but of course you can also create bindings for other fields like Top MarginLeft Margin and Orientation if you have created columns for these fields in the 'PageSetup' data source from step 1.
     
  12. Click Add to document.

  13. Save the template and upload it to the Admin Center, for example as Blank document:

    ps_blankdocument.png

  14. Now when a user located in the United States creates a blank document then the page format is automatically set to 'Letter':

    ps_layoutsizeletter.png

    When a user located in The Netherlands creates it then the page format is automatically set to 'A4':

    ps_layoutsizea4.png

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.

  1. Create a data source named 'PageSetup' and add a PaperWidth and PaperHeight column (both of Type Text). Then add the values as shown below:

    ps_pagesetup.png

     
    • Always use centimeters ("cm") as the unit of measurement.
    • With numbers like '29.7' always use a decimal point as divider, not a comma.
      
  2. In the User Profile create a Dropdown with the Name 'PageFormat' and Label 'Page format' and link it to the Name column of the 'PageSetup' data source.

  3. Create a template. On the Advanced tab in Template Designer click + Add property, then in the Type field select Page Setup.

  4. In the field PaperWidth type this binding: {{UserProfile.PageFormat.PaperWidth}}.

  5. In the field PaperHeight type this binding: {{UserProfile.PageFormat.PaperHeight}}.

  6. Click Add to document.

  7. Save the template and upload it to the Admin Center, for example as Blank document.

  8. In the user profile the user can choose to use 'Letter or 'A4' as the page format:

    ps_pageformat.png

  9. 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:

    pageformat.gif


Related articles

 

 

document page setup dynamics smart fields
Was this article helpful?
0 out of 0 found this helpful

Comments

0 comments

Article is closed for comments.