Generate Word DOCX from Templates via JavaScript

JavaScript library to create, modify & convert Microsoft® Word DOCX files.

What is docxtemplater?

docxtemplater is an open source JavaScript library helps in creating and editing Word DOCX files from a template. The Word JavaScript library enables users to customize generated document using Word itself. The library is easy to handle and does not require any technical skills to edit a Word template. The library has also provided several modules for specific functionality.

The docxtemplater library supports several features related to DOCX file creation and handling such as add images, insert formatted text in a Word document, insert headers/footers, image replacement with any existing properties, create tables, add watermark text, update page margins, insert footnotes to a document and much more.

Previous Next

How to Install docxtemplater?

The recommend and easiest way to install docxtemplater is via npm. Please use the following command for a smooth installation.

Install docxtemplater via npm

 npm install docxtemplater pizzip 

Generate Word DOCX via JavaScript

The docxtemplater library helps in creating DOCX documents in a Node.js app as well as in the browser with ease. It also allows to modify the existing DOCX documents to insert tables, images, text, paragraphs and more.

Insert & Manage Tables in Word Documents

The DOCX library enables software developers to create a table with just a couple of lines of JavaScript code. The library has included several methods for creating and managing tables in a document such as table creation from the scratch, vertical loop table creation or by copying cells, merge cells of a table, insert rows and columns, define a width for rows, and column and so on.

Add Footnote to a Word Documents

The free docxtemplater library includes support for adding footnotes to a DOCX Word document. The library gives full control for the customization of the footnotes. You can add numbers in superscript and apply different styles to the content of the footnote with ease.

Add and Modify Images in DOCX

The open source docxtemplater library gives software programmers the power to create insert images inside a word document. The library allows setting the image width and height, align images, add a caption for the images, use angular expressions to set image sizes, and so on. You can also retrieve image data from any data source such as base64 data, filesystem, URL and Amazon S3 stored image. One great features of the library is that you can avoid the pictures bigger than their container.