Skip to content
ankerform

In practice9 min read

Digital document generation: templates, placeholders and PDFs from form data

How to build document templates with placeholders, conditional sections and tables and automatically generate PDFs from form submissions and CRM data.

Person writing on a tablet with a stylus

In many offices, documents are produced the same way: a Word template is opened, names, addresses and amounts are copied from e-mails or the CRM, and the result is saved as a PDF and sent. It works, but it is error-prone. A wrongly copied amount or a forgotten paragraph is often only noticed when the customer asks.

Digital document generation means producing documents from data that has already been captured. This article shows how this works with templates and placeholders in Ankerform and what to consider when setting them up.

This is not about automating every document. Individual letters, negotiation correspondence or expert reports will still be written by hand. Worthwhile candidates are documents that occur frequently, always follow the same structure and consist largely of data that is captured anyway. That is exactly where copying causes the most errors, and exactly where a template saves the most time.

From form to document

The basic idea is simple: data is captured once in a form or already exists in the CRM. A template defines what the document looks like and where each piece of data goes. On generation, the placeholders are replaced by real values and a PDF is produced.

Use caseData sourceDocument
Handover of a rented flat“Übergabeprotokoll” (handover report) formReport with meter readings and signatures
On-site order“Digitale Auftragsannahme” (digital order intake) formOrder confirmation
Consent“Einwilligungserklärung” (declaration of consent) formConsent with proof
Notary preparation“Notarbeauftragung” (notary instruction) formData sheet for the draft purchase contract
Flat application“Mieterselbstauskunft” (tenant self-disclosure) formSummary of the self-disclosure

The difference from word processing lies less in the result than in how you get there. A document is no longer created by copying but by merging template and data. This makes it reproducible: the same data always produces the same document, and a correction to the template applies to all future documents.

How a template is built

A template in Ankerform consists of building blocks arranged one below the other. This is deliberately simpler than a freely designed word-processing document, but it ensures a consistent layout and reliable PDFs.

  • Heading and paragraph for running text with placeholders.
  • Field table for label–value pairs, such as “Tenant: Max Example”.
  • Data table for lists, such as all meter readings or all rooms from a repeatable group.
  • Image or logo, for example your organisation’s logo from the branding settings.
  • Columns, divider, spacer and page break for layout.
  • Checkbox that is shown ticked depending on the data.
  • Conditional section and repeat for variable content.
  • Signature block with defined roles, such as tenant and landlord.

For forms with many fields, the field table is the quickest route to a clear document. You define a label and a placeholder row by row, and the PDF shows both neatly aligned. For running text with embedded details, such as “The handover of the flat at {{ property.address }} took place on …”, the paragraph block is better suited.

Using placeholders correctly

Placeholders are written in double curly braces, for example {{ contact.fullName }}. In addition to form fields, fixed groups are available: document (number, title), date (today, year), organisation (name, address, contact details), contact (salutation, name, address, e-mail, phone), property (title, address, property type, price, living area, rooms, year of construction) and submission (number, date received).

Filters for formatting

Raw data is rarely ready to print. With filters appended using a vertical bar, you format values directly in the template. Formatting follows German conventions, as the examples show.

FilterExampleResult
date{{ submission.date | date }}17.11.2026
datetime{{ submission.date | datetime }}Date with time
currency{{ property.price | currency }}420.000,00 €
number{{ property.livingArea | number:1 }}82,5
upper / lower{{ contact.lastName | upper }}EXAMPLE
yesno{{ haustiere | yesno }}Yes or no
join{{ raeume | join }}Kitchen, bathroom, hallway
default{{ contact.phone | default:"not provided" }}Fallback text for empty values

Placeholders from form fields use the field key from the form. Choose these keys early and make them meaningful, such as “einzugsdatum” (move-in date) rather than “feld_12”. Renaming them later is possible but requires updating every template that uses the key. The placeholder picker in the template editor shows the available paths so you do not have to know them by heart.

Handling missing values deliberately

Not every field is always filled in. You can control how a missing value is displayed: blank, as a line for handwritten additions or, in the preview, as a visible marker. The marker is useful when creating a template because you immediately see which placeholders are not yet being filled.

  • For documents produced entirely digitally, “blank” combined with the “default” filter is usually the best choice.
  • For documents printed and completed on site, the fill-in line works well.
  • Check every new template in the preview with sample data before using it in a workflow.

Conditional sections and repeats

Many documents contain sections that only apply under certain conditions. A handover report only needs a section on defects if defects were reported. A conditional section is controlled by the same kind of conditions as the conditional logic in the form.

Repeats produce the same block for each entry in a list. If several rooms with condition and photo were captured in the form using a repeatable group, the document contains a separate section for each room. For tabular data, the data table is often clearer.

Example: handover report

  1. Header with logo, document number and date.
  2. Field table with property address, tenant and landlord.
  3. Data table with meter type, meter number and reading.
  4. Repeat across all rooms with condition and remarks.
  5. Conditional section “Defects found”, only if there are defects.
  6. Signature block for tenant and landlord.

Test conditional sections with at least two records: one where the condition is met and one where it is not. This shows whether the document remains complete and well structured in both cases and avoids empty headings or orphaned tables.

Generating documents automatically

Documents can be generated manually from a submission or a CRM record. More often, they are generated by a workflow automation: a new submission of a particular form triggers the “generate document” action. The PDF is stored and, in the next step, can be sent by e-mail or passed on for signature.

Each document receives a sequential number. Your organisation’s branding, meaning the logo and details from the organisation settings, is applied automatically, so templates do not have to be maintained individually.

Maintaining and versioning templates

A template is not a one-off project. Legal notices change, forms gain new fields and the team wants changes to the layout. To keep documents reliable nonetheless, a few simple rules are needed.

  • Assign a responsible person to each template.
  • Do not change templates in productive use without testing. Check changes in the preview with sample data first.
  • If you rename or remove a form field, check all templates that use this placeholder.
  • Keep wording with legal significance, such as privacy notices, up to date in one place and apply it to all affected templates.
  • Clearly mark samples that serve only as examples as non-binding.

Documents that have already been generated are not affected by later changes to the template. This matters, because a signed report must be preserved exactly as it was signed.

Design: legible rather than decorative

A document is read, printed, filed and sometimes retrieved years later. Legibility and a clear structure are therefore more important than an elaborate design.

ElementRecommendation
HeadingsShort and unambiguous, at most three levels
Field tablesFor master data such as parties, property and date
Data tablesFor lists with identical columns, such as meter readings
LogoOnce in the header, not repeated on every page
Page breaksPlaced deliberately before signature blocks so they do not stand alone on a page

Your branding with logo and organisation details is maintained centrally. If your address changes, for example, you update it once in the organisation settings, and all documents generated from then on use it.

Signature and proof

If a template contains a signature block, the generated document can be sent for signature. Ankerform offers the simple electronic signature under eIDAS. Each signatory receives their own link. Once complete, a final PDF with an audit trail is produced, and a hash value of the document records that it has not been altered since.

The simple electronic signature is suitable for many everyday documents such as reports, consents or order confirmations. Where German law requires the written form under § 126 BGB, for example for terminating a residential tenancy under § 568 BGB, it is not sufficient. If in doubt, clarify which form your document requires; this note is not legal advice.

Put it into practice in Ankerform

This article is for general information and is not legal advice.

Curved spiral staircase inside an exposed concrete building

Ready for structured processes?

Try free for 7 days with a template.