Generate PDF from Word Template in Zapier
What this guide covers
Instead of filling out the same contract, invoice, or certificate manually every time, you design it once in Microsoft Word - with {{placeholders}} where the dynamic values go - and let Zapier + PDF4me fill it in automatically. Every time a trigger fires (a form submission, a new spreadsheet row, a CRM deal closed), PDF4me merges your live data into the template and produces a finished PDF or Word document in seconds. No code, no mail-merge add-ins, no manual PDF exports. This guide walks through every step: building the template, structuring your data, configuring the Zapier action, and routing the output to storage or email.
How It Works
PDF4me uses Mustache double-brace syntax - {{VariableName}} - inside standard .docx files. You supply a data object (JSON, XML, or CSV) and PDF4me replaces every placeholder with the matching value, then renders the document as a PDF or DOCX.
{{ClientName}}Replaced with the matching JSON value
{{#Items}}...{{/Items}}Expands one row per array item
{{#ShowDiscount}}...{{/ShowDiscount}}Section appears only when value is truthy
→ Full syntax reference: Word Template Syntax
Step 1 - Create Your Word Template
Open any .docx file in Microsoft Word and replace every value that should change per document with a {{placeholder}}. The placeholder name is what you will match in your JSON data - keep it short, descriptive, and consistent.
Common placeholders for typical documents:
| Document type | Example placeholders |
|---|---|
| Invoice | {{ClientName}}, {{InvoiceNumber}}, {{DueDate}}, {{Total}} |
| Contract | {{PartyOne}}, {{EffectiveDate}}, {{Jurisdiction}}, {{SignatureDate}} |
| Certificate | {{RecipientName}}, {{CourseName}}, {{CompletionDate}}, {{IssuedBy}} |
| Offer letter | {{CandidateName}}, {{Position}}, {{Salary}}, {{StartDate}} |
Tips for a clean template:
- Use placeholders in table cells, headers, footers, and text boxes - PDF4me replaces them everywhere in the document
- Keep the
.docxstyling (fonts, colors, borders) exactly as you want the output to look - PDF4me renders the document without altering formatting - For line-item tables, add one data row with
{{#Items}}on the first cell and{{/Items}}at the end of the row - the loop expands automatically

A Word template with {{placeholders}} in body text, table cells, and headers. Save as .docx and store in Google Drive, Dropbox, or OneDrive.
Step 2 - Prepare Your Document Data
PDF4me accepts data in JSON (recommended), XML, or CSV format. JSON maps most naturally to Zapier trigger output because you can build the object directly from field references.
Minimal JSON example - invoice:
{
"ClientName": "Acme Corporation",
"InvoiceNumber": "INV-2026-0042",
"DueDate": "2026-06-15",
"Items": [
{ "Description": "Web design", "Qty": "1", "UnitPrice": "$3,200", "LineTotal": "$3,200" },
{ "Description": "Hosting setup", "Qty": "1", "UnitPrice": "$400", "LineTotal": "$400" }
],
"Subtotal": "$3,600",
"Tax": "$360",
"Total": "$3,960"
}
In Zapier, you can build this JSON string using the Code by Zapier step, or map it directly if your trigger (Typeform, Jotform, Google Sheets, HubSpot) already returns the fields you need.
Tip: Download the ready-made sample data file to see exactly how PDF4me expects the JSON structure - then adapt it to your template's placeholder names.

Map JSON data directly from trigger output fields or paste a static JSON string. Both approaches work - use whatever your Zap produces.
Step 3 - Configure the PDF4me Generate Document Action
Add a new action step in Zapier, search for PDF4me, and select Generate Document. Authenticate with your PDF4me API key once - Zapier reuses the connection across all your PDF4me actions.
Action Parameters
Required: Template Document Name, Template File, Data Format, and document data (as text or file). Output Format defaults to PDF if not set.
| Parameter | Required | What it does | Example value |
|---|---|---|---|
| Template Document Name | Yes | Filename of your Word template including the .docx extension. Map from the filename output of the step that retrieves your template file. | invoice-template.docx |
| Template File | Yes | Binary content of the .docx template. Map from the file data output of a Google Drive Get File, Dropbox Download File, or OneDrive Get File step. | (binary from Google Drive) |
| Data Format | Yes | Format of the data you are supplying. JSON is recommended for Zapier workflows. XML and CSV are also supported. | JSON |
| Data As Text | One of these | The merge data as a text string - a JSON object, XML document, or CSV content typed or mapped directly in the field. Use this when building JSON from trigger fields in the same Zap. | {"ClientName":"Acme","Total":"$3,960"} |
| Data File | One of these | Binary data file containing the JSON, XML, or CSV. Use this when a prior Zap step retrieves a data file from cloud storage rather than constructing it inline. | (binary from Dropbox) |
| Output Format | No | Format of the generated document. PDF produces a tamper-proof, print-ready file. Word (DOCX) produces an editable document. Defaults to PDF. | PDF |
| Output Name | No | Custom filename for the generated document. Build it dynamically from trigger fields for organised storage - for example Invoice_{{InvoiceNumber}}.pdf. | Invoice_INV-2026-0042.pdf |

Map the template binary and set Data Format to JSON. Paste or map your JSON into Data As Text, or map a file from cloud storage into Data File.

Set Output Format to PDF for a print-ready file, or Word to keep the document editable. Use a dynamic Output Name built from trigger fields.
Step 4 - Save or Send the Output
The PDF4me action returns a File output - the generated PDF or DOCX binary. Map this into any downstream Zap step.
Google Drive Upload File, Dropbox Upload File, OneDrive Upload File, SharePoint Create File - map File → File Content and set a dynamic Folder Path and File Name.
Gmail Send Email, Outlook Send Email - map File → Attachment. Set the To address from a trigger field so each document goes to the right recipient automatically.
Add both steps after the PDF4me action - upload to Drive and send via Gmail in the same Zap. Both steps receive the same File output, no duplication needed.

Map the PDF4me File output into the File Content field of any storage or email step. Set Folder Path and File Name dynamically from trigger fields.

Attach the generated document directly to an email by mapping File → Attachment in Gmail or Outlook Send Email.
Complete Zap Flow

The complete Zap: trigger provides data → PDF4me merges it into the Word template → output saves to storage and/or sends via email.
Example Zap Flows
Example Zap FlowsReal automation patterns using PDF4me Generate Document with Word templates.
- Typeform: New Entry - collects client name, project scope, start date, and agreed fee.
- Code by Zapier: builds a JSON object from the Typeform fields.
- Google Drive: Get File - retrieves the contract template .docx.
- PDF4me: Generate Document - merges JSON into template, output format PDF.
- Gmail: Send Email - attaches the contract PDF, sends to the client's email from the form.
- Google Sheets: New Row - a new invoice record added by your billing team triggers the Zap.
- Dropbox: Download File - retrieves the invoice template .docx from a shared templates folder.
- PDF4me: Generate Document - merges row data (client, items, amounts) into the template as JSON.
- Google Drive: Upload File - saves the invoice PDF to the matching client folder.
- Slack: Send Message to #billing - posts the invoice number and Drive link for the team.
- HubSpot: Deal Stage Changed to "Closed Won" - triggers when a sales deal is marked as won.
- HubSpot: Get Contact - retrieves the associated contact's name, email, and role.
- OneDrive: Get File Content - retrieves the offer letter template .docx.
- PDF4me: Generate Document - merges contact details and deal data; Output Format set to Word for further review.
- SharePoint: Create File - saves the DOCX to the HR folder for signature and onboarding.