Generate Documents Effortlessly
Templater is the deterministic engine behind document generation: it turns your Word, Excel and PowerPoint templates into professional reports, spreadsheets and presentations from any data source — including structured output from AI services. Anyone can build the simple part for free — Templater is the rest of it, already built and battle-tested for fifteen years.
Minimal Interface, Maximum Flexibility
Its minimal and stable API allows seamless integration into third-party applications, without requiring any custom coding. Designers and domain experts can work directly in Microsoft Office, boosting productivity and allowing end-users to customize templates easily.
Comprehensive Feature Support
Templater understands most Office features, enabling companies, non-profits and individuals worldwide to generate documents cost-effectively. Detailed examples and use cases are available on Github.
Proven and Mature
With over 15 years of development, Templater is a mature product. The change log lists updates and improvements over the years.
Easy Installation
Templater installation is done in two simple steps:
- Grab the latest copy of Templater library →
- Include it in your project…
…or just use it through package managers such as Maven and Nuget
Code sample
using NGS.Templater; class Program { static void Main(string[] args) { using (var document = Configuration.Factory.Open("Spreadsheet.xlsx")) { document.Process(new { Teacher = "Makayla", Age = 33 }); document.Process(new [] { new { Name = "Riley" }, new { Name = "Camila" }, new { Name = "Morgan" }, new { Name = "Hailey" } }); } } }
import hr.ngs.templater.*; import java.io.*; class Program { static void main(String[] args) { try(FileInputStream fis = new FileInputStream("Template.docx"); FileOutputStream fos = new FileOutputStream("Result.docx"); TemplateDocument document = Configuration.factory().open(fis, "docx", fos)) { document.process(new Object() { public final String Tag = "a cover"; }); } } }
import hr.ngs.templater.* object Program { case class Student(Name: String) def main(args: Array[String]) { val document = Configuration.factory.open("Presentation.pptx") document.process(new { val Teacher = "Makayla"; val Age = "33" }) document.process(List( Student("Katherine"), Student("Claire"), Student("Olivia"), Student("Ashley") )) document.close() } }
Full documentation
Templater provides a minimal set of methods to get started with processing your templates.
- method IDocumentFactory.Open
- Use the Open method to load your template.
-
Open(string path)- opens a document from the specified path
- Templater will recognize the appropriate document format from the file extension
-
Open(Stream input, string extension, Stream output, CancellationToken cancelToken)- opens a document from the input stream
- the extension string indicates the type of document in the stream
- writes the document to the output stream
- cancellation token to cancel the processing
- Returns ITemplateDocument
- method ITemplateDocument.Process
- Method Process will replace tags with corresponding data.
-
Process(data)
- modifies the ITemplateDocument file or stream by replacing tags with rules according to specific data types
- Returns ITemplateDocument
Articles
- Introduction to Templater explains the basics of Templater: how and why it works
- Conversion to PDF shows how to convert documents into PDF
- Beyond mail merge demonstrates advanced use cases beyond simple mail-merge
- Business intelligence friendly guides integration with advanced features such as OLAP cubes
- No for loops and if statements highlights major differences from other document automation solutions
- Processing JSON shows how to work with JSON data types
Templater Editor — the natural next step
You have seen what templates can do with the library and the examples. The next step is designing and validating your own templates without leaving Office — that is what Templater Editor does.
- Tag listing is managed by your application, exposing domain-specific tags with explanations and examples — designers see exactly what they can use
- Tag detection and analysis validates the document before it meets real data, highlighting potential issues and suggesting solutions
- Run Templater inside Office against your own data — a JSON file from the examples, or an ODBC query, HTTP request and more
- Debugging with replay tracks every step of Templater execution, so adjusting templates or modifying data becomes trivial
- The familiar Office interface requires minimal training and can even be used directly by end users
Try it in five minutes: download any template and its JSON example from the demo page, open the template in Word, Excel or PowerPoint with the add-in installed, load the JSON in the Run dialog and press Run. When something looks wrong, the debugger replays every step of processing.
Videos
Explore these videos to see Templater Editor in action, understand how tags and templates work and learn how to quickly generate documents without complex coding.
User manual
More information about how Templater works is available in the PDF documentation
Readme can also be found in quick (zip) download.
Javadoc
Javadoc is available here.
