Templates
Docamint uses standard Word (.docx) files as templates. You design your document visually in Word and insert tags where dynamic data should appear.
Basics
What is a Docamint Template?
A Docamint template is a normal Word document containing placeholders like:
{{customer.name}}
{{order.number}}
{{order.total | currency}}
{{#each order.items}}
{{this.name}} - {{this.qty}}
{{/each}}
Docamint merges these tags with JSON or XML data to produce final DOCX and PDF outputs.
Placement
Where Tags Can Be Used
You can place tags anywhere inside a Word document:
- Body text
- Tables
- Headers
- Footers
- Lists
- Text boxes
- Shapes
Docamint preserves all formatting: fonts, colors, spacing, alignment, styles, and table layout.
Design
Designing Templates
You design templates visually in Word. Recommended best practices:
- Use tables for structured layouts (invoices, statements, reports)
- Use Word styles for consistent formatting
- Avoid copying from HTML - Word formatting becomes messy
- Use placeholders like “{{customer.name}}” instead of hard-coded text
- Use loops for repeating rows (line items, transactions, etc.)
Example
Example Template
A simple invoice template might look like this:
Invoice Number: {{invoice.number}}
Invoice Date: {{invoice.date}}
Bill To:
{{customer.name}}
{{customer.address}}
Items:
{{#each invoice.items}}
• {{this.name}} - Qty: {{this.qty}}, Total: {{this.total | currency}}
{{/each}}
Grand Total: {{invoice.total | currency}}
Upload
Uploading Templates
Templates are uploaded through the Docamint UI or API.
The system validates:
- Tag syntax
- Loop structure
- Conditional structure
- Helper usage
Validation helps catch typos before generating documents.