insert_image

The insert_image function inserts an image into the result document during Master Template execution. The image is read from the file system or passed as base-64 encoded data. Sizing and placement can be controlled through parameters.

@(insert_image (filename; x; y; width; height; ...))

The result of the function insert_image is of type TEXT.

This function has a variable number of parameters:

  1. filename, type TEXT. This is the name of the file containing the image.
  2. x, type TEXT; optional. This is the X-coordinate where the image should be placed on the page.
  3. y, type TEXT; optional. This is the Y-coordinate where the image should be placed on the page.
  4. width, type TEXT; optional; width of the image.
  5. height, type TEXT; optional; height of the image.

The result of the function insert_image must be inserted in the result document to take effect.

In addition to the preceding parameters, the function insert_image has a number of optional parameters that can only be used if they are specified by name. The following is a list of the optional parameters:

  1. base64data, type TEXT. It loads image data from a variable or Field.
  2. resource, type TEXT. It loads image data from the Resources folder in KCM Designer.
  3. keepaspect, type TEXT. It maintains aspect ratio when resizing the image. Allowed values are Y (default) or N.
  4. align, type TEXT. It aligns the image relatively to the x and y coordinates.
  5. overtext, type TEXT. It controls placement of the image relatively to the text. Allowed values are Y or N (default).
  6. wrap, type TEXT. It determines if text should be wrapped around the image. Allowed values are none (default), square, and topbottom.
  7. dpi, type TEXT. It overrides the DPI ratio of the image when calculating its size.
  8. resample, type TEXT. It resamples the image before storing it in the Microsoft Word document.
  9. title, type TEXT. Specifies a title for the image.

  10. description, type TEXT. Specifies a description for the image. If this parameter is omitted, the file part of the filename parameter is used as the description.

For more information on the parameters, see Named parameters.

The functionality of the function insert_image is available for Master Templates in the Microsoft Word DOCX, HTML, and AiaDocXML outputs. In Quick Templates and Master Templates in other document formats, the use of this function is ignored.

Only images with base-64 data and images from resources are processed during the transformation from AiaDocXML to HTML, all other images are ignored. Also, the keepaspect, align, wrap, dpi, resample, coordinates x, y, and overtext parameters are ignored when the HTML output is created.