LibreOffice Template Fill Merge

Replace placeholders in DOCX template and render merged records to PDF using LibreOffice

Mail-merge style PDF generation from DOCX templates.

How it works:

  • Fill template placeholders like {{name}}, ${name}, <<name>>
  • Supports one record or array of records
  • Render each merged DOCX with LibreOffice and combine into one PDF

Example Results

2 examples

Single Record Merge

Fill one record into a DOCX template and render one PDF

libreoffice-template-fill-merge-example1.pdf View File
View input parameters
{ "templateFile": "/Users/quyue/www/elysia-tools/public/samples/docx/merge-template.docx", "mergeDataJson": "{\"name\":\"Alice\",\"company\":\"Elysia Tools\",\"date\":\"2026-02-17\"}" }

Multi Record Merge Batch

Render multiple merge records and combine them into one PDF

libreoffice-template-fill-merge-example2.pdf View File
View input parameters
{ "templateFile": "/Users/quyue/www/elysia-tools/public/samples/docx/merge-template.docx", "mergeDataJson": "[{\"name\":\"Alice\",\"company\":\"Elysia\"},{\"name\":\"Bob\",\"company\":\"Tools\"},{\"name\":\"Carol\",\"company\":\"Studio\"}]" }

Click to upload file or drag and drop file here

Maximum file size: 100MB Supported formats: application/vnd.openxmlformats-officedocument.wordprocessingml.document

Key Facts

Category
Documents & PDF
Input Types
file, textarea
Output Type
file
Sample Coverage
4
API Ready
Yes

Overview

The LibreOffice Template Fill Merge tool allows you to automate document creation by injecting data into DOCX templates and rendering the results as professional PDFs. It functions like a mail-merge system, supporting various placeholder formats to generate single or batch documents efficiently.

When to Use

  • Generating personalized letters, invoices, or certificates from a structured data source.
  • Creating batch reports or contracts where multiple documents need to be rendered and combined into one file.
  • Standardizing document output by using a consistent DOCX template for repetitive administrative tasks.

How It Works

  • Upload your DOCX template containing placeholders like {{name}}, ${name}, or <<name>>.
  • Provide your data in JSON format, either as a single object or an array of records.
  • The tool replaces placeholders with your data, processes each record through LibreOffice, and merges the resulting pages into a single PDF.

Use Cases

Automated generation of personalized client contracts from a CRM export.
Batch creation of employee certificates or training completion documents.
Mass production of shipping labels or invoices based on order data.

Examples

1. Personalized Client Letter

Account Manager
Background
The manager needs to send a formal welcome letter to a new client with specific company details.
Problem
Manually editing Word documents for every new client is prone to typos and formatting errors.
How to Use
Upload the welcome_template.docx and input the client's name and company details in the JSON field.
Example Config
{"name":"Alice","company":"Elysia Tools","date":"2026-02-17"}
Outcome
A clean, professional PDF letter with the client's information correctly inserted.

2. Batch Invoice Generation

Billing Clerk
Background
The clerk needs to generate monthly invoices for three different vendors simultaneously.
Problem
Creating individual files for each vendor is time-consuming and difficult to manage for printing.
How to Use
Upload the invoice_template.docx and provide an array of vendor data in the JSON field.
Example Config
[{"name":"Alice","company":"Elysia"},{"name":"Bob","company":"Tools"},{"name":"Carol","company":"Studio"}]
Outcome
A single PDF file containing three separate invoices, ready for printing or distribution.

Try with Samples

json, xml, pdf

Related Hubs

FAQ

Which placeholder formats are supported?

The tool supports {{name}}, ${name}, and <<name>> syntax within your DOCX template.

Can I process multiple records at once?

Yes, by providing an array of objects in the Merge Data JSON field, the tool will generate a document for each entry and combine them into one PDF.

What happens if I provide a single object instead of an array?

The tool will generate a single PDF document based on that specific record.

Is the output always a PDF?

Yes, the tool uses LibreOffice to render the final merged document into a PDF format.

Are there limits on the template file size?

The tool supports file uploads up to 100MB.

API Documentation

Request Endpoint

POST /en/api/tools/libreoffice-template-fill-merge

Request Parameters

Parameter Name Type Required Description
templateFile file (Upload required) Yes -
mergeDataJson textarea Yes -

File type parameters need to be uploaded first via POST /upload/libreoffice-template-fill-merge to get filePath, then pass filePath to the corresponding file field.

Response Format

{
  "filePath": "/public/processing/randomid.ext",
  "fileName": "output.ext",
  "contentType": "application/octet-stream",
  "size": 1024,
  "metadata": {
    "key": "value"
  },
  "error": "Error message (optional)",
  "message": "Notification message (optional)"
}
File: File

AI MCP Documentation

Add this tool to your MCP server configuration:

{
  "mcpServers": {
    "elysiatools-libreoffice-template-fill-merge": {
      "name": "libreoffice-template-fill-merge",
      "description": "Replace placeholders in DOCX template and render merged records to PDF using LibreOffice",
      "baseUrl": "https://elysiatools.com/mcp/sse?toolId=libreoffice-template-fill-merge",
      "command": "",
      "args": [],
      "env": {},
      "isActive": true,
      "type": "sse"
    }
  }
}

You can chain multiple tools, e.g.: `https://elysiatools.com/mcp/sse?toolId=png-to-webp,jpg-to-webp,gif-to-webp`, max 20 tools.

Supports URL file links or Base64 encoding for file parameters.

If you encounter any issues, please contact us at [email protected]