About IMAGELearn how the IMAGE command merges images from URLs or static resources into templates.May 23, 2026Knowledge
InformationArticle BodyOverview The IMAGE template command merges images into templates using JavaScript functions that return image data. Use IMAGE to insert graphics from URLs or Salesforce static resources across Word and PowerPoint templates. Key Functionalities Merge images from external URLs or Salesforce static resources.Control image size with optional height, width, max height, max width, and units parameters.Place dynamic visuals in Word and PowerPoint templates. Syntax {# IMAGE img('imageUrl', options) #} {# IMAGE sfimg('staticResourceName', options) #} Parameters img(imageUrl, options) imageUrl: URL of the image. The URL must point directly to the image response you want to merge. options (optional): JavaScript object to control size and units. height (optional): Sets the image height. The width is adjusted automatically to maintain the aspect ratio.maxHeight (optional): Sets the maximum height for the image. Images taller than this value are capped to this value while preserving aspect ratio.width (optional): Sets the image width. The height is adjusted automatically to maintain the aspect ratio.maxWidth (optional): Sets the maximum width for the image. Images wider than this value are capped to this value while preserving aspect ratio.units (optional): The unit used for height, maxHeight, width, and maxWidth. Defaults to px. Supported: px, cm, in. sfimg(srName, options) srName: Name of the Salesforce static resource containing the image.options (optional): Same options as img(). Examples Example 1: Merge an image from a URL {# IMAGE img('https://example.com/logo.png';) #} Example 2: Merge a static resource with custom size {# IMAGE sfimg('MyStaticResource', { height: 100, width: 100, units: 'px' }) #} Example 3: Apply maximum dimensions to an image // A 50x25 px image will be set to 100x50 px // A 50x75 px image will be set to 67x100 px {# IMAGE sfimg('MyStaticResource', { height: 100, maxWidth: 100, units: 'px' }) #} Notes Use img() for external URLs and sfimg() for static resources.Setting both width and height will resize the image to the specified dimensions and may change its aspect ratio.If both maxHeight and maxWidth are specified, the image will be scaled to fit within the smaller resulting dimensions while preserving its aspect ratio. Conclusion The IMAGE command enables you to merge branded logos or other graphics directly into your templates. Next Steps IMAGE in Word IMAGE in PowerPoint TitleAbout IMAGEURL NameAbout-IMAGE