
How to Create DOCX Document Templates
A comprehensive guide to preparing Microsoft Word files for automated document generation, including template variables and font embedding.
How to Create DOCX Document Templates
This guide explains how to prepare Microsoft Word (.docx) files for automated document generation within the system. You will learn how to use template variables and ensure your document looks perfect by embedding custom fonts.
1. Using Template Variables
The system uses a placeholder syntax to dynamically inject data into your documents.
Basic Syntax
To insert a variable, wrap the variable name in double curly braces:
{{ variable_name }}
Example:
To display a customer's name, use: {{ customer_full_name }}
Where to Find Variables
You can find the list of available variables for each document type in the "Available Variables" modal within the Document Templates settings.

2. Embedding Fonts (Critical)
To ensure that your generated PDFs look exactly like your template, even when using custom or premium fonts, you must embed the fonts within the DOCX file.
Why Embed Fonts?
If fonts are not embedded, the PDF generation server might replace your custom fonts with standard ones (like Times New Roman or Arial), which can break your layout.
How to Embed Fonts in Microsoft Word (Windows)
- Open your
.docxtemplate. - Click on File > Options.
- Select the Save tab on the left.
- Scroll down to the bottom and check the box "Embed fonts in the file".
- Uncheck "Embed only the characters used in the document" (recommended for better compatibility).
- Click OK and Save your document.

For Mac Users:
Word for Mac usually embeds fonts automatically when saving as a PDF, but for our template system, ensure you save as a standard .docx and check for compatibility settings if specific premium fonts are used.
3. Best Practices for Design
- Fixed Heights: Avoid fixed height containers if content inside variables might wrap to multiple lines.
- Header/Footer: You can place variables inside headers and footers; they will be populated correctly.
- Tables: Ensure table columns have defined widths if you want strict control over the layout.
4. Uploading Your Template
Once your document is ready:
- Navigate to Project Settings > Document Templates.
- Click Add Template for the appropriate category (e.g., Agreement, Demand Note).
- Upload your
.docxfile. - Test the generation using the Preview button on an actual record.
