Image
An image field renders a real image at the placeholder location at document-fill time. It is detected by the substring image in the field name — just like a graph field, but for images. Images are inserted inline, sized according to the configuration, and silently skipped if no value is supplied.
How to write an image placeholder
The placeholder is a plain {{ field_name }}. Any name containing image qualifies. The image substitution rule requires the placeholder to be the only content in its paragraph — don’t mix the placeholder with surrounding text on the same line.
{{ profile_image }}
{{ adviser_signature_image }}
{{ company_logo_image }}
Placeholder must be alone in the paragraph
Wrong:
Logo: {{ company_logo_image }}
Right:
Logo:
{{ company_logo_image }}
Configuration after upload
Open the field configuration modal for an image field. You will see:
- Width — in pixels, slider range 50–800.
- Height — in pixels, slider range 50–600.
- Use natural size — clears both width and height so the image renders at its intrinsic dimensions.
- Preview toggle — an A4 mockup so you can sanity-check sizing.
There is no colour picker, font controls, or chart-type selector for image fields — those are graph-only.
How image data flows at fill time
At fill time AdviceDocs accepts image data in two shapes:
- S3 reference (preferred) —
{ "type": "s3_image", "s3_key": "path/to/image.png" }. The renderer downloads the bytes from S3. - Raw bytes — passed through directly to the docx renderer.
Plain strings (a path, URL, or filename) are not supported — the renderer logs a warning and treats the field as empty.
Supported formats
- PNG — preferred for transparent backgrounds.
- JPEG — preferred for photos.
- SVG — supported; auto-converted to PNG before embedding.
- GIF — supported as a static image.
Missing or invalid image
If the field has no value, or the S3 download fails, the placeholder paragraph is silently cleared. No error is raised in the document; a warning is logged on the server. The surrounding paragraphs are left untouched.
Common pitfalls
Placeholder mixed with text
Only one of width/height
External URLs not supported
Header and footer images use a different path
Pre-optimise large images
Syntax to copy
{{ profile_image }}
{{ adviser_signature_image }}
{{ company_logo_image }}
{{ portfolio_chart_image }}
{{ company_logo_image }}
Figure 1 — Company logo