Specification of Docly™ DOCX Template Framework

Docly™ developed framework to use Microsoft Office Word (2010 or above) files as templates to merging data and output DOCX and/or PDF files.

(C) 2014 - 2023 Docly™ | www.docly.net

About

The Docly™ DOCX Template Framework makes it easy to output DOCX (and PDF files - combined with Kingsoft Writer API) from Microsoft Office Word files as templates. Making it easy for users familiar with Microsoft Word to setup their design and look of the output for their solutions.

Merging data fields

Specify fields to merge with your data.

> Insert text with "MergeField"

Use the insert field option in word. Then select "MergeField", enter data field name and click OK. Merged fields are shown with brackets in the document.

Example

> Insert images with "MergeField"

Insert a placeholder image. Right click the image, open alternative text and enter link(FIELDNAME). Fieldname beeing the actual name of the field with the image data. See example below.

link(YourImageFieldName)

Example

Where the field value should be the filename of the image.

Downloaded image, specify the url (http or https):

link("http://www.yourserver.com/image1.jpg")

To merge a value and download the url:

link(join("http://www.yourserver.com/",YourMergeFieldName))

> Insert links

Use {{ and }} as tokens (not the # token) in the link like this:

Merging tables and lists

Merge arrays of data into your document.

> Merge data into table

Specify loop(listname) in the property window of the table. Right click the table and click "Table properties".

Examples

> Merge a list of items (not table)

Still use a bounding table with no header and only one 100% width column. See the next guide on how to remove the padding in the table.

> Remove table padding

Right click inside the table. Select the "Cell" tab and the Options button. Remove "Same for whole table" checkbox and enter 0 cm in all sides. See image below.

Example

Installation on server

> Libre Office components

Install latest Libre Office from:
https://www.libreoffice.org/

See also

More information about the available functions to call within a DOCX template is described at:
http://tech.docly.net/Hash-Templates