How to create a Word template with placeholders

A DocGen template is an ordinary Word (.docx) file. Wherever a value changes from one document to the next, you type a placeholder in double curly braces. DocGen finds the placeholders, builds a form from them and fills them in every time you generate a document.

1. Start from a document you already send

Open a contract, an offer or a report you write again and again. Keep its layout as it is: fonts, tables, headers, footers and logos stay exactly as you designed them. Only the parts that change for each client or project become placeholders.

2. Type the placeholders

Replace each changing value with a name in double curly braces, such as {{client_name}}. The same placeholder can appear several times; every copy gets the same value.

Placeholder types
Type this in Word DocGen fills in
{{client_name}} The value of the field client_name.
{{engineer.name}} A property of a saved record. Pick an engineer, a client or a product from a collection, and all its properties fill in at once.
{{logo}} An image field: the picture is inserted at this spot.
{{#is_company}} … {{/is_company}} The text in between appears only when is_company is Yes.
{{^is_company}} … {{/is_company}} The text in between appears only when is_company is No or empty.

Rules that keep templates working

  • Names use letters, digits and underscores. A dot separates a saved record from its property, as in {{engineer.name}}. Names can be up to 120 characters long.
  • Placeholders work in body text, in tables, in headers and in footers.
  • Word sometimes stores a word in several pieces after you edit it. DocGen puts the pieces back together, so you can type and correct placeholders normally.
  • A field left empty prints nothing. A section also works with other fields: it appears when the field has a value, for example {{#company_vat}}VAT number: {{company_vat}}{{/company_vat}}.
  • A Yes/No field outside a section prints “Yes” or “No”, or the words you choose for it, such as “Company” and “Private person”.
  • Paragraph fields keep the line breaks you type.
  • DocGen only fills in values. It never runs formulas, macros or other code from a template.

3. Check the fields DocGen proposes

When you upload the template, DocGen lists every placeholder it found and proposes a field for each one, guessing the type from the name:

  • names with logo, signature, photo, image or stamp become image fields;
  • names with date or birthday become date fields;
  • names that start with is_, has_, are_ or can_ become Yes/No fields;
  • names with a dot become properties of a saved record;
  • everything else starts as a text field.

Change any type you need: paragraph, number, date, Yes/No, dropdown, image or collection. Fields can be required, have a default value, or appear in the form only when another field has a given value.

4. Choose how dates are written

Each date field has its own format in the document:

9 March 2026 in each format
Format In the document
DD.MM.YYYY (default for new fields) 09.03.2026
DD/MM/YYYY 09/03/2026
MM/DD/YYYY 03/09/2026
YYYY-MM-DD 2026-03-09

5. Add images and signatures

An image placeholder is replaced by a picture: a logo, a photo or a scanned signature. Upload PNG or JPEG files of up to 5 MB and choose the width for each field: small (4 cm), medium (8 cm) or large (15 cm). The height follows the picture's proportions. Pictures that are already part of the template stay as they are.

6. Pick fonts that keep your PDFs identical to Word

Word files keep your fonts as they are. For PDFs, DocGen uses fonts with the same character widths as the most common Word fonts, so lines and pages break exactly where they break in Word:

Fonts in PDFs
Font in your template Font in the PDF
Calibri Carlito (same widths)
Cambria Caladea (same widths)
Arial, Helvetica Liberation Sans (same widths)
Times New Roman Liberation Serif (same widths)
Courier New Liberation Mono (same widths)

Other fonts, including Aptos (the newer Word default) and brand fonts, are replaced by DejaVu in PDFs, which is wider and can move line and page breaks. For PDFs that match Word, write the template in one of the fonts above.

Example templates

Download one, open it in Word and see how the placeholders are written.

Service agreement

Client fields, a project date and the responsible engineer picked from a saved list.

{{client_name}} {{client_address}} {{project_date}} {{engineer.name}}

Download .docx

Engineering certificate

Adds a section shown only for companies and the engineer's signature as an image.

{{#is_company}} {{company_vat}} {{engineer.authorizationNumber}} {{engineer.signature}}

Download .docx

Try it with your own template

Free plan with 5 documents a day. No card needed.

Start free