Images

To insert images in your template, you have two options:

  1. Use an image placeholder.
  2. Use an image text tag.

Image Placeholder

Image placeholders allow you to replace existing images in your template while preserving their size, position, and styling.

Consider the following template:

Image Placeholder Example
{{ FullName }}{{ JobTitle }}

To let TemplateDocs know you want to replace the placeholder image, insert a tag in its alt text:

  1. Right-click the placeholder image.
  2. Select "View Alt Text...".
  3. Insert the tag in the alt text ({{ProfilePicture}} in this example).
View Alt Text Context Menu
Alt Text Panel

Provide the image details using the image data structure shown below:

This preview shows the tag fields exactly as they appear in the TemplateDocs UI.

The resulting document will look like this:

Image Placeholder Example
John SmithReal Estate Agent

Image Text Tag

If you prefer, you can still use standard template tags to insert images into the document. Simply place the tag where you want the image to appear. For example:

{{ ProductImage }}

When you generate a document from the template, the tag will be replaced with the actual image.

Consider the following data for the tag:

This preview shows the tag fields exactly as they appear in the TemplateDocs UI.

The resulting document will look like this:

Image Text Tag Example

Image Properties

PropertyTypeDescription
_typestring
Must be set to "image"
sourcestring
Required. URL or Base64 encoded image data
formatstring
Required. One of: image/png, image/jpeg, image/bmp, or image/gif
widthnumber
Image width in pixels. Required when using text tags, optional when using image placeholders
heightnumber
Image height in pixels. Required when using text tags, optional when using image placeholders
altTextstring
Optional. Alternative text for accessibility
transparencyPercentnumber
Optional. Transparency level from 0 (opaque) to 100 (transparent)

Examples

URL Image Source

This preview shows the tag fields exactly as they appear in the TemplateDocs UI.

Base64 Image Source

This preview shows the tag fields exactly as they appear in the TemplateDocs UI.

Transparency and Alt Text

This preview shows the tag fields exactly as they appear in the TemplateDocs UI.
Images - TemplateDocs Documentation