# Template Preferences

Once you have created your HTML template, or uploaded your fillable PDF/PPTX/DOCX template, you can customise how the document generation should work for that template under `Preferences` tab.

<figure><img src="https://191679573-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LDwD-wIOendMUiQ8uVr%2Fuploads%2FUzw9rwf4phT7TcC7DV5O%2FTempalate%20preferences.png?alt=media&#x26;token=ff53c152-2878-48be-a82a-bcbf8f60de58" alt=""><figcaption><p>Preferences Tab.</p></figcaption></figure>

#### Updating basic settings

<figure><img src="https://191679573-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LDwD-wIOendMUiQ8uVr%2Fuploads%2FzCez4qIFOvcvfx6XSQg6%2FUpdate%20Prferences.png?alt=media&#x26;token=3b1818b8-af83-44f3-9eb6-7dffe971bc5a" alt=""><figcaption><p>Basic Info section.</p></figcaption></figure>

<table><thead><tr><th width="189">Preference</th><th> </th></tr></thead><tbody><tr><td>Title</td><td>Template name for your reference within Docupilot Dashboard.</td></tr><tr><td>Description</td><td>Template description to help idenitify what this template is used for.</td></tr><tr><td>Output file name</td><td><p>The file name of the generated document. Dynamic tokens can be configured here to create more personalised name for your Document.</p><p>Example: <code>Proposal for {{company}}</code></p></td></tr></tbody></table>

#### **Template Status - Publish VS Draft:**

The upper right corner of the Template Details page has a button for quickly switching the template status to either **Publish** or **Draft**.

Alternatively, you can update the status under **Preferences → Basic Info → Template Status** by selecting either **Publish** or **Draft** and **saving your changes**.

<div align="center" data-full-width="true"><figure><img src="https://191679573-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LDwD-wIOendMUiQ8uVr%2Fuploads%2Fs8JcLi7TZ8WyjHtvxhP3%2FDraft.png?alt=media&#x26;token=7c3cd31c-20ed-46e0-a698-928f8855ace1" alt=""><figcaption><p>Template status - Draft mode</p></figcaption></figure> <figure><img src="https://191679573-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LDwD-wIOendMUiQ8uVr%2Fuploads%2FVKhadhgPejgUldSgc2WV%2FPublish%20.png?alt=media&#x26;token=031533a4-87f3-444d-a922-aa1f3c0d6f1d" alt=""><figcaption><p>Template status - Publish mode</p></figcaption></figure></div>

If the template is in **"Draft"** mode, your  generated document will have a watermark saying "This document is created using Docupilot" and your document credits will not be consumed. Once you have tested your templates and your integration completely, you can change your template status to **Publish**.

### Output Preferences:

<figure><img src="https://191679573-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LDwD-wIOendMUiQ8uVr%2Fuploads%2FTCctCO0WSQmKYNQ4DaLy%2FOutput%20Preferences.png?alt=media&#x26;token=206eaa05-29fc-4070-a58f-8ed9857374f5" alt=""><figcaption><p>Output Preferences section.</p></figcaption></figure>

<table><thead><tr><th width="148">Preference</th><th> </th></tr></thead><tbody><tr><td>Output Type</td><td><p>The output type of generated document.</p><p>Supported output types:<br>For "Document Builder" templates <code>PDF</code>, <code>HTML</code> and <code>PNG</code> <br>For "DOCX" templates <code>DOCX</code>, and <code>PDF</code></p><p>For "PPTX" templates <code>PPTX</code>, and <code>PDF</code></p><p>and for Fillable PDFs only <code>PDF</code> output is supported.</p></td></tr><tr><td>Page Size</td><td>The page size of the output document. You can choose between <code>A4/Letter/Legal/A3/A5/Tabloid</code> for your Document builder templates.  <br>Page Size settings are not applicable for other template types (output page size for will be same as template page size)</td></tr><tr><td>Render Mode</td><td>. You can select between the "<code>For viewing on screen</code>" and " <code>For printing</code>" options for your HTML templates.</td></tr><tr><td>Orientation</td><td>The orientation of the output document. You can choose between <code>Portrait</code> and <code>Landscape</code> for your HTML templates. Orientation settings are not applicable for other template types.</td></tr><tr><td>Time Zone</td><td>The time zone to be used for the reserved tokens {{_date}} and {{_datetime}}</td></tr></tbody></table>

### Advanced Settings:

<figure><img src="https://191679573-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LDwD-wIOendMUiQ8uVr%2Fuploads%2FpivlQyhsXa6C14FAzIFh%2FAdvanced%20Settings.png?alt=media&#x26;token=2d9a53e1-c19a-4336-aabd-4c1edf15a21c" alt=""><figcaption><p>Advanced Settings section.</p></figcaption></figure>

#### Auto Number:

Auto Number (`{{_auto_number}}`) displays a unique number across each generated document. Enable it and define a starting number and with each new document generation, that number will be automatically incremented. To learn more about the Auto number feature [here](https://help.docupilot.app/document-template/tokens-merge-field#auto-number).

#### Password:

If the output document type is PDF, you can set the password for the generated pdf in template.You can set a dynamic password for your created PDF using Tokens.

For example: `{{abbreviate customer_name}}{{format_date agreement_date format="DDMM"}}` can be used to create a dynamic password. If your customer name is "Acme Corp Limited" and agreement date is "2024 January, 15", the password will be "ACL1501"

#### Page Margins (inches):

Docupilot allows you to adjust the size of the top, bottom, left, right page margins in inches for each page in the template. Default page margins are set to 0.4 inches on all sides.

### Header and Footer :&#x20;

<figure><img src="https://191679573-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LDwD-wIOendMUiQ8uVr%2Fuploads%2Fbm7K3QzVDfLMHI8XyNXt%2FHeader%20%26%20Footer.png?alt=media&#x26;token=5790785a-b82a-4e55-8f8a-de0916d73fbe" alt=""><figcaption><p>Header and Footer section.</p></figcaption></figure>

In this section, Header and Footer for a document can be inserted in a **Document Builder (HTML)** template.

#### Page number and Total number of pages:

You can print **Page numbers** and **Total number of pages** in a document template using predefined tokens `{{_page_no}}` and `{{_total_pages}}.`

<table><thead><tr><th width="223">Token</th><th>Explanation</th></tr></thead><tbody><tr><td><code>{{_page_no}}</code></td><td>prints the current page number in generated document.</td></tr><tr><td><code>{{_total_pages}}</code></td><td>Prints the total number of pages in generated document.</td></tr></tbody></table>

Inserting `{{_page_no}}/{{_total_pages}}`  in header or footer will print `1/12` on page 1, `2/12` on page 2, and so on on each page for a generated document that contains 12 pages.

{% hint style="warning" %}
Note : `Headers` and `footers` of a document are dependent on `page margins` of the template. Greater the sizes of margins, more information can be printed as `header` and `footer` of the document.
{% endhint %}
