Skip to content

Documentor Render a Word template

Replace double-curly-braced placeholders with values in a Word document.
LabelTypeRequiredDescription
Template URLstringyes

Publicly accessible URL of the base Word document (.docx) to use.

ValuesJSONyes

Key-value mapping of the variable names and the values to replace them with.

PicturesJSONyes

Key-value mapping of the variable names and the pictures to replace them with. Values should be either URLs to the images or objects with a required url property and (both optional) width and height.

Output formatchoiceyes

Format of the resulting document.

Choices:

  • .docx (Microsoft Word)
  • .pdf (Portable Document Format)
Remove metadatabooleanno

Whether to remove metadata, such as title and author name, from the resulting PDF document.

The following JSON is returned.

Example output
{
"ok": true,
"outputURL": "https://connector-backend.smartyellow.net/artefacts/8f7f69af-a809-423d-bfae-2f2b78a5ec6c.png",
"warnings": []
}
  • outputURL contains the URL to the generated document. Read more on these URLs here.

  • warnings may contain warnings about pictures you provided:

    • The format “$format” of the picture for “$placeholder” is unknown. Allowed are: jpg, png, gif, bmp.

    • Your provided dimensions for the “$placeholder” image result in an aspect ratio of 1:2.65, which does not match its intrinsic ratio of 1:3. This may result in a stretched image. You can resolve this by only setting a width or height instead of both.