Images
The <Image> element renders bitmap content from a file or from raw data
supplied by the template engine.
From File
<Image src="logo.png" width="150" height="80"/>
From Template Data
When using the template engine, images can be injected as raw RGB data:
<Image data="chart_image" data_width="400" data_height="300"
width="200" height="150"/>
The data attribute references an image id registered via
DocraftTemplateEngine::add_image_data() or
DocraftTemplateEngine::add_base64_image_data().
Attributes
Attribute |
Type |
Description |
|---|---|---|
|
string |
Path to the image file (PNG or JPEG). |
|
string |
Template image id for raw data injection. |
|
int |
Pixel width of the raw data image. |
|
int |
Pixel height of the raw data image. |
Supported formats: PNG, JPEG, and raw RGB (via template engine).