Demo Readme Changelog Buy footnotes module Releases RSS

Summary (version 3.0.3)

This module exposes a tag to add a footnote to the document

This module is available as part of the docxtemplater PRO plan.



You will need docxtemplater npm install docxtemplater

Install this module with npm install --save "$url"


Your docx should contain the text: {:footnote foot}

var FootnoteModule=require('docxtemplater-footnote-module')

var opts = {};
var footnoteModule=new FootnoteModule(opts);

var zip = new JSZip(content);
var docx=new Docxtemplater()
    .setData({foot:'The text of the footnote'})

var buffer= docx
        .generate({type:"nodebuffer", compression: "DEFLATE"});



It is possible to customize how footnotes look like with the refProperties option.

For example, to have the numbers in the footnotes section written in superscript, you can do :

var footnoteModule=new FootnoteModule({
    refProperties: '<w:vertAlign w:val="superscript"/>'


You can test that everything works fine using the command npm test. This will also create some docx files under the root directory that you can open to check if the generation was correct.

Building in the browser

You can build a release for the browser with the following commands

npm install
npm run preversion

You will have build/footnotemodule.js.



Make it possible to style footnotes with option refProperties


Mark package as private in package.json


It now works even if some footnotes already exist (if word/footnotes.xml exists)


Initial release.

Edgar Hipp

I'm the creator of docxtemplater. I work on making docxtemplater great since 2013.