Documentation
Everything you need to create Word templates, add placeholders, and generate PDF and HTML documents.
Overview
TmplVision turns your Word documents into reusable PDF and HTML templates. The typical workflow involves two roles:
Document Creator
Designs the Word template, adds placeholders for dynamic content, uploads it to TmplVision, and tests it in the Test Center.
Developer
Integrates document generation into applications using the REST API, passing variable data and receiving generated PDFs or HTML documents.
This guide covers the document creator workflow. For API integration, see the API Reference.
Creating a Template
Follow these steps to create a new template in the TmplVision dashboard:
- Name your template — Give it a clear, descriptive name so you can easily find it later.
- Add a description — Optionally describe what this template is used for.
-
Upload your .docx file — Drag and drop or click to upload your Word document. Maximum file size is 10 MB. Only
.docxfiles are supported. - Save — Click save to create your template. The system will automatically detect all placeholders in your document.
.docx file should contain placeholder syntax wherever you want dynamic content to appear. See the sections below for all supported placeholder types.
Simple Text
Basic text replacement. Wrap your variable name in double curly braces. You can optionally provide a default value if the field is empty.
{{customer_name}}
{{company | default:N/A}}
Numbers
Format numbers as currency or with specific decimal places and locale.
{{price | format:currency | decimals:2 | currency:EUR | locale:de-DE}}
{{quantity | format:number | decimals:0}}
currency or number
EUR, USD)
de-DE, en-US)
Dates
Format date values using a date format pattern.
{{invoice_date | format:DD.MM.YYYY}}
{{created_at | format:YYYY-MM-DD}}
Images
Insert images into your document. Specify width and height in centimeters. When generating via the API, upload the image file using the image_<key> field name in the multipart request.
{{logo | width:6cm | height:4cm}}
{{signature | width:8cm | height:3cm}}
image_<key> field in the API request. For example, a placeholder named logo expects a file upload in the field image_logo. Maximum file size is 10 MB per image.
Conditionals
Show or hide sections of your document based on conditions. Supports comparison and logical operators.
{{#if show_discount}}
Discount applied!
{{#else}}
No discount
{{/if}}
Operators
| Operator | Description | Example |
|---|---|---|
== | Equal to | {{#if status == "active"}} |
!= | Not equal to | {{#if type != "draft"}} |
> | Greater than | {{#if amount > 100}} |
< | Less than | {{#if quantity < 10}} |
>= | Greater or equal | {{#if score >= 50}} |
<= | Less or equal | {{#if age <= 18}} |
&& | Logical AND | {{#if active && verified}} |
|| | Logical OR | {{#if admin || manager}} |
Loops
Repeat content for each item in a list. Useful for tables, line items, and lists.
{{#each items}}
{{@number}}. {{name}} - {{price}}
{{/each}}
Loop Variables
| Variable | Description |
|---|---|
@index | Zero-based index of current item |
@number | One-based number of current item |
@first | True if this is the first item |
@last | True if this is the last item |
@length | Total number of items in the list |
@item | The current item value (for simple arrays) |
Text Transforms
Transform the case of text values.
{{name | uppercase}}
{{email | lowercase}}
{{title | capitalize}}
Test Center
The Test Center lets you preview your template with sample data before using it in production.
- Open a template — Navigate to your template's detail page.
- Switch to the Test Center tab — Click on the "Test Center" tab at the top.
- Fill in test values — Enter sample data for each placeholder detected in your template.
- Generate — Click the generate button to create a test document.
- Download — Download the generated PDF to review the output.
Packs
Packs let you bundle multiple templates together and process them in a single request. The result is a single merged PDF containing all generated documents in the order you define.
Creating a Pack
- Name your pack — Give it a clear name that describes the bundle.
- Add a description — Optionally describe the purpose of this pack.
- Select templates — Drag and drop templates from the available list to add them to the pack. You can reorder them by dragging.
- Save — Click save to create your pack. The templates will be processed in the order shown.
Testing a Pack
Test your pack by generating a merged document with sample data:
- Open the pack — Navigate to the pack's detail page.
- Fill in values per template — Each template in the pack has its own set of placeholders. Fill in test data for each one.
- Generate — Click generate to create the merged PDF containing all templates.
- Download — Download and review the generated PDF.
HTML Generation
When generating HTML output from your Word templates, the following elements are fully supported:
- Paragraphs, headings, lists (ordered and unordered)
- Bold, italic, underline, strikethrough
- Tables (basic structure)
- Hyperlinks
- Images (embedded as base64-encoded inline images)
- Complex page layouts (columns, page breaks, margins)
- Headers and footers (page-level concepts not native to HTML)
- Precise font sizes and colors (HTML output uses semantic markup)
- Complex table formatting (e.g. merged cells)
For pixel-perfect output that preserves the full Word layout, use the PDF generation endpoint instead.
For Developers
Once a document creator has set up and tested a template, developers can integrate document generation into any application using the REST API.
The API lets you:
- Generate PDFs or HTML documents by sending variable data and image uploads
- List all previously generated documents for a template
- Download generated documents
Authentication uses an API token passed in the x-apitoken header. Tokens can be generated from the TmplVision dashboard.
Full endpoint documentation with request/response examples and error codes.