Advanced Document Templating

This Plug-in provides a Smart Service to create .docx documents with a dynamic structure. The plug-in is based on the library XDocReport.  Dynamic structures supported include lists, tables, and lists of images. The styling of the document is defined within the template.


  • Create a dynamic docx document using a template docx
  • Support for dynamic structures such as table and list items
  • Styling of the generated document is defined within the docx template
  • Support for a list of images within the docx template
  • Includes an optional parameter which allows the developer to define whether the template images use the template's image sizes or the original image's sizes

A PDF guide, included in the download file, provides full usage instructions.  Note that familiarity with xdocreport template using freemarker engine would be needed.

  • Hi - I've add the documentation back to the download package

  • The documentation doesn't exits in the file

  • My experience with this plugin in version upgrade was troublesome. The same template used in the previous version of plugin i.e AdvancedDocumentTemplating (v1.0.4), undergone some series of changes in the implementation level of Template, before the Template was working fine with the ### fields without any spaces in between two ### characters, later when the upgrade happened to AdvancedDocumentTemplating (v1.0.6) the plugin failed to differentiate ### fields without spaces.This should contain space between the set of ### characters for a template to be generated without any issues.

  • Lessons Learned (in case it helps):

    • Start with a clean template and build from there, the XML can be severely distorted on templates given to you by clients
    • When adding text where you want to put your tokens, use single abbreviation letters (e.g. "a", "b", "c"). DocX has a tendency to split your tokens up.
    • Simply opening a template can modify the backend XML and split up your tokens (e.g. from "${d.action}" to "<t>${</t><t>d.action}</t>"). This will make it so Appian can't find the token. You can get around this by keeping a local copy of the document.xml and modifying that directly with Notepad++
    • Start with the difficult "lists" first, single elements don't fail often. Do one list at a time to make sure you have it right before moving onto the next list. 
    • Make sure all of your formatting and your column widths for tables are set before you even move to document.xml update. I was not able to modify column widths after the fact without breaking things severely. 
    • Get familiar with XML tags, you'll need to recognize your paragraphs, rows, columns, and instructional text.
    • The "<<" & ">>" gave me parsing errors; removing these often solved these issues.
    • You MUST give the plugin a document, even if it's a blank one
    • Tokens are case sensitive, so make sure everything matches
    • Resizing images makes images quite small (think from full page size, to a thumbnail)
    • For designers new to docX development, you can access the "document.xml" by changing your docX to a zip, opening it, removing the document.xml, modifying it, placing it back into the zip, saving, and modifying the zip back to a docX.
    • Make sure to save your errors out of the smart service, sometimes they are worth looking at, other times not so much. There is definitely no sense to the "column number" they give you.
  • Here is a conversation that could help someone using the plugin

  • Hi - I've updated the download package to include the guide

  • There is no PDF guide included with the download file.  Does someone have a link to the documentation for this plugin?