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:

  1. Name your template — Give it a clear, descriptive name so you can easily find it later.
  2. Add a description — Optionally describe what this template is used for.
  3. Upload your .docx file — Drag and drop or click to upload your Word document. Maximum file size is 10 MB. Only .docx files are supported.
  4. Save — Click save to create your template. The system will automatically detect all placeholders in your document.
Your .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.

Syntax
{{customer_name}}
{{company | default:N/A}}

Numbers

Format numbers as currency or with specific decimal places and locale.

Syntax
{{price | format:currency | decimals:2 | currency:EUR | locale:de-DE}}
{{quantity | format:number | decimals:0}}
format currency or number
decimals Number of decimal places
currency ISO currency code (e.g. EUR, USD)
locale Locale for formatting (e.g. de-DE, en-US)

Dates

Format date values using a date format pattern.

Syntax
{{invoice_date | format:DD.MM.YYYY}}
{{created_at | format:YYYY-MM-DD}}
DD Day of the month (01–31)
MM Month (01–12)
YYYY Four-digit year

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.

Syntax
{{logo | width:6cm | height:4cm}}
{{signature | width:8cm | height:3cm}}
The placeholder name must match the 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.

Syntax
{{#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.

Syntax
{{#each items}}
  {{@number}}. {{name}} - {{price}}
{{/each}}

Loop Variables

Variable Description
@indexZero-based index of current item
@numberOne-based number of current item
@firstTrue if this is the first item
@lastTrue if this is the last item
@lengthTotal number of items in the list
@itemThe current item value (for simple arrays)

Text Transforms

Transform the case of text values.

Syntax
{{name | uppercase}}
{{email | lowercase}}
{{title | capitalize}}

Test Center

The Test Center lets you preview your template with sample data before using it in production.

  1. Open a template — Navigate to your template's detail page.
  2. Switch to the Test Center tab — Click on the "Test Center" tab at the top.
  3. Fill in test values — Enter sample data for each placeholder detected in your template.
  4. Generate — Click the generate button to create a test document.
  5. 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.

Packs require a Business or Enterprise plan. See Pricing for details.

Creating a Pack

  1. Name your pack — Give it a clear name that describes the bundle.
  2. Add a description — Optionally describe the purpose of this pack.
  3. Select templates — Drag and drop templates from the available list to add them to the pack. You can reorder them by dragging.
  4. 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:

  1. Open the pack — Navigate to the pack's detail page.
  2. Fill in values per template — Each template in the pack has its own set of placeholders. Fill in test data for each one.
  3. Generate — Click generate to create the merged PDF containing all templates.
  4. 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)
Limitations: The following Word features are not fully supported in HTML output and may not render as expected:
  • 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.

API Reference

Full endpoint documentation with request/response examples and error codes.

View API Reference