To display images on invoices, add image components to cells.
Note: You can create more than one active version of an invoice template per locale, and use conditional expressions to determine which fields appear on a version of an invoice template. You can only use conditional expressions in templates that you create or that you copy from a marketplace-provided default template. You cannot add conditional expressions to marketplace default templates. For more information, see Create conditional expressions.
You can add image components to cell components. See Build cell components.
To populate the required source property in image components, you can upload an image and acquire an image URL for it. See Manage images.
In the Appdirect Template_EN_US default template, see lines 62-65.
To download the default template, go to .
{ "type": "image", "properties": { "visible" : "true", "src": "http://path-2-img" }, "style": { "height": "100px", "width": "200px" } }
Element | Type | Description | ||
---|---|---|---|---|
image | object | Defines styles, behaviors, and content, for image components. The images appear on invoices. | ||
type | string |
Required. Defines the component as type image. Valid value: image |
||
properties | object | Required. Defines the source for an image and component visibility. | ||
visible | boolean |
Required. Defines whether component appears on invoices. Valid values: true | false |
||
src | string |
Required. URL for image source. To acquire a URL for an image that you store on the AppDirect platform, see Manage images. When Format: https://* | {{Invoice Logo}} | null |
||
style | object |
Required. Defines formatting for the image. When you populate height and width, the image appears on the invoice with those dimensions. When you populate only height or width, the image dimensions adjust to maintain its aspect ratio. Valid values: HTML element names and CSS styles for the named HTML element. All HTML styles. Only relevant styles that the Invoice Builder can render appear in the user interface preview and the PDF. |
||
height | string |
Image height in pixels, ems, millimeters, points, or inches. Format: [0-9]+(px|em|mm|pt|in) Example: 34px |
||
width | string |
Image width in pixels, ems, millimeters, points, or inches. Format: [0-9]+(px|em|mm|pt|in) Example: 34px |