Advanced Document Templating

Overview

This plugins allows to generate DOCX files from a DOCX template and an XML data model from Appian. It also allows to convert a DOCX into PDF through an opensource (with limited capabilities) library.

Key Features & Functionality

  • Smart Service to Generate a DOCX from a DOCX Template and an XML data model
  • Smart Service to convert DOCX to PDF through an opensource (with limited capabilities) library
Anonymous
Parents
  • 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.
Comment
  • 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.
Children
No Data