Skip to main content

2 posts tagged with "Word templates"

View all tags

Create advanced templates for document generation

· 12 min read
SEO and Content Writer

Document generation with mail merge is the trick of reading values from a data source and dropping each one into the matching placeholder in a template. You keep two things: a template that holds the merge fields (the variables waiting to be filled) and a data source that supplies the values plus everything that stays the same on every copy. PDF4me's reporting engine takes those two files and hands back a finished document.

PDF4me accepts Word, HTML, and PDF templates, and the richest of the three is Word. With a small, readable syntax you can design one Word template that covers invoices, receipts, contracts, quotes, or any personalized document, then generate thousands of them from data. This guide walks through the whole syntax — merge fields, conditions, formatting, tables, images, and inline HTML — with copy-paste examples and a sample template you can download and run. Every syntax link points at the exact page in the Word Template Syntax documentation.

The building blocks at a glance
Merge fields
The core placeholder. Write <<[FieldName]>> in Word and the engine swaps it for the matching value from your data.
Conditions
Show or hide content with <<if>>, <<elseif>> and <<else>> so one template covers every case.
Formatting
Shape a value inline with <<[token]:"format">> for dates, number formats and text case.
Tables and loops
Repeat a row or a whole section for every item in a list with <<foreach>>.
Images
Drop a logo, photo or signature into a text box with <<image [imageUrl]>> from a URL or Base64.
Inline HTML
Render pre-formatted HTML straight into the document with the <<[token] -html>> switch.

Generate Document action in Zapier: mail merge Word templates into finished PDFs with PDF4me

· 15 min read
PDF4me Team

Generate Document is a PDF4me action for Zapier that performs a mail merge: it takes a Word, HTML or PDF template plus a JSON or XML data file and returns the filled document. A Zap can watch a folder, merge each record, and save every result without anyone opening Word.

Every mail merge tutorial you will find assumes a person is sitting in Word, clicking through a wizard. That works once. It does not work when a hundred invoices need generating on a schedule, or when the data arrives from a system rather than a spreadsheet on someone's desktop. This post covers the template syntax and the Zap that runs the merge unattended.

The flow at a glance
1. New File in Folder
Dropbox trigger watching the folder your data lands in.
2. Find File
Dropbox fetches the Word template from its own folder.
3. Generate Document
PDF4me merges the data into the template.
4. Create Loop From Line Items
Only needed when the merge returns many documents.
5. Upload File
Dropbox saves each finished document.