Skip to main content

Images

A picture goes into a document in one of two ways:

  • the image block, a figure of its own in the flow, with its alternate text, its caption and a style for its box;
  • the inline [image] tag, a picture set inside a line of text, such as a logo before a name or a flag in a table cell.

Both read the same files, and both can name a picture declared once under the document's images.

The image block​

{
"image": {
"src": "images/site-plan.png",
"alt": "Site plan of the Riverside depot, loading bays to the north",
"caption": "Figure 2: Site plan",
"width": 360
}
}
KeyTypeRequiredDescription
srcstringYesThe picture: the name of an image declared under images, a data: URI, or a file (see Where a picture comes from)
altstringNoWhat a listener hears in place of the picture. Empty ("") marks the picture decorative: drawn, and not announced. An accessibility claim requires it on every image block, empty or holding more than white space
captionstringNoA caption announced with the image, such as "Figure 2: Site plan"; markup allowed. Drawn where the style's captionSide puts it (above, by default) and tagged as the figure's caption
widthnumberNoWidth in points. Absent or 0, the image's own width, or the width its proportions give beside a height
heightnumberNoHeight in points. Absent or 0, the image's own height, or the height its proportions give beside a width
stylestringNoThe named style of the image's box

With neither size given, a picture is drawn at its own size, one pixel to a CSS pixel (96 per inch, so a 400-pixel-wide file is 300pt wide); the resolution written in the file is not read. With one size, the other follows the picture's proportions. With both, the picture fills that box, stretched unless the style's objectFit says otherwise.

An image block takes the content width as its container, as any block does. Placed inside a table cell or a column, it is held to that cell or column.

Where a picture comes from​

src (and the inline tag's path) takes one of three things:

FormExampleWhat is read
A declared name"logo"The image declared under document.images by that name
A data: URI"data:image/png;base64,iVBORw0..."The bytes written in the URI itself
A file path"images/logos/acme.png"Your workspace's files first, then a file relative to the document's own folder

The engine fetches no URL, and a rooted or climbing path (/assets/logo.png, ../logo.png) is refused with an error: the image is not drawn and the report says why. A file that cannot be found is reported the same way.

A path may carry a token, so the picture is chosen by the data:

{ "image": { "src": "$data.company.logoPath", "alt": "$data.company.name", "width": 120 } }

Supported formats​

FormatExtension
PNG (every colour type and bit depth, interlaced or not, transparency kept).png
JPEG (baseline or progressive, greyscale or RGB), embedded as it is.jpg, .jpeg
GIF.gif
BMP (uncompressed).bmp

Any other file is refused and reported, never guessed at: TIFF, WebP, a CMYK JPEG or a lossless one among them. Vector art in an .svg file is drawn by the svg node, not as an image.

Declaring images once​

document.images declares pictures by name. Every use names the entry, and the file is embedded once however many times it is drawn.

{
"document": {
"images": {
"logo": {
"src": "images/logos/arctis-devices-logo.png",
"alt": "Arctis Devices logo",
"width": 90,
"height": 22,
"style": "framed"
}
},
"styles": {
"framed": { "backgroundColor": "#eef2f7", "border": "0.5pt dashed #6b7280", "padding": 6 },
"boxed": { "border": "1pt solid #1e3a5f", "padding": 4 }
},
"content": [
{ "image": { "src": "logo", "alt": "Arctis Devices logo" } },
{ "p": "The same mark, in a style of its own:" },
{ "image": { "src": "logo", "alt": "Arctis Devices logo", "style": "boxed" } }
]
}
}

An entry takes the keys of an image block. A use takes from its entry what it does not state itself:

KeyFrom the entry when the use omits it
width, heightYes (a use's 0 counts as omitted)
captionYes
styleYes; a use's own style wins
altYes for what a reader announces; but under an accessibility claim the schema still asks every image block for its own alt

A picture declared in a component reaches the document that uses the component, so a shared letterhead can bring its logo with it.

Sizing, fitting and placing​

An image's box takes the style keys any block takes. The ones that matter most for a picture:

Style keyValuesWhat it does
objectFitfill (default), contain, cover, none, scaleDownHow the picture fills the box width and height make: fill stretches it, contain fits it whole, cover fills the box and crops, none keeps its own size, scaleDown the smaller of none and contain. Always centred
captionSidetop (default), bottomWhere the caption is drawn and announced
justifySelfstart, center, end, left, rightWhere an image narrower than its container sits; written, it wins over textAlign
float, clearleft, right / left, right, bothTakes the image out of the flow to one edge, with the text after it running past its side; clear puts a later block below it
clipPathcircle(), ellipse(), inset(), polygon(), path()Clips the image to a shape
borderRadius, border, padding, backgroundColorThe image's box, drawn around the picture
opacity0 to 1How opaque the picture is
transform, rotateTurns, slants or scales the image's box
marginTop … marginLeftSpace around the box

The full vocabulary is on Box model and Paint.

{
"document": {
"styles": {
"cover": { "objectFit": "cover", "borderRadius": 8, "border": "1pt solid #1e3a5f", "captionSide": "bottom", "justifySelf": "center" },
"portrait": { "objectFit": "cover", "clipPath": "circle()", "float": "right", "marginLeft": 12 }
},
"content": [
{
"image": {
"src": "images/photos/depot.jpg",
"alt": "The depot's loading bays at dawn",
"caption": "Figure 1: Riverside depot",
"width": 240,
"height": 140,
"style": "cover"
}
},
{
"image": {
"src": "images/photos/manager.jpg",
"alt": "Portrait of the depot manager",
"width": 80,
"height": 80,
"style": "portrait"
}
},
{ "p": "The depot manager joined in 2019 and runs a team of forty. The text of this paragraph runs past the round portrait floated at the right edge, and returns to the full measure below it." }
]
}
}

Across pages​

An image is never cut by a page: one that does not fit in the room left starts the next page. An image taller than any page's content area is drawn from the top of the content area and runs past the bottom edge, and the report says so in a NOTICE giving both heights.

Images and accessibility​

An image block is tagged as a figure: its alt is what a screen reader announces in its place, and its caption is tagged as the figure's caption. An empty alt says the picture is decorative, as alt="" does on the web - a divider, or a logo beside the name it stands for - and the picture is drawn as page decoration a screen reader passes over. The Word output marks it decorative too, with no description, so a PDF Word saves from it leaves it out of the structure as well. Under a PDF/UA claim every image block must carry an alt; an inline image takes the tag's alt=, or the one declared under its name in document.images. A figure without a description is reported and the claim withheld. See Accessibility.

In DOCX​

The Word output carries block and inline pictures as pictures in the text, at the same size, with alt as their description. objectFit crops or pads the picture as in the PDF, and opacity is kept. A floated picture is placed beside the text, which wraps past it. An inline or floated picture's padding, border, background and rounded corners are drawn on the picture's own shape. Four corners of one radius are kept, and a rounded picture with a padding is trimmed at its padding edge rather than inside the padding, which the report notes. A block picture in the flow does not keep its rounded corners, and a clipPath shape is not carried: the picture is drawn whole in its box, and the report says so.

Inline images​

The [image] tag sets a picture inside a line of text. It works in every text element: paragraphs, headings, table cells, list items, headers and footers. The inline tag is described with barcodes on Media tags.

[image, path, width|height, alt=…, style=…]

The [img] shorthand is also supported:

[img, path, width|height]
ParameterDescription
pathA name declared under images, a data: URI, or a file path relative to the document (your workspace's files are looked up first). The engine fetches no URL, and a rooted or climbing path (/…, ../…) is refused
width|heightOptional. Omitted, the image's own size; a width alone (150), the height from its proportions; both, separated by a pipe (150|75). Each a number in points or a length with its unit (pt, in, mm, px)
alt=Optional. What a screen reader announces in the picture's place, the block image's alt. A text holding a comma is written in quotes: alt="Logo, blue"; an empty one, alt='', marks the picture decorative
style=Optional. A named style, as on a block image: its objectFit places the picture in its box, its opacity fades it, and its padding, border, borderRadius and backgroundColor draw a box around it. The tag's size is the picture's, and the padding and border add to it. The style's other keys, such as a margin, do nothing on a line, and the report names them

What the tag leaves unstated comes from the image declared under its name in images, as it does for a block image: its alt, its style, and, when the tag states neither side, its width and height.

{ "p": "[image, images/team.jpg, 40|40, style=thumb, alt=\"Ada, in the lab\"] Ada Okafor, lead chemist" }

A style can frame the picture on its line. Here a 28 x 28 swatch is cropped to its box, ringed in navy around a cream band and rounded to a circle. The picture is trimmed to the circle inside the band, and the words after it start past the ring:

{
"document": {
"styles": {
"swatch": { "objectFit": "cover", "padding": 3, "border": "1pt solid #1e3a5f", "borderRadius": 18, "backgroundColor": "#f3efe7" }
},
"content": [
{ "p": "Sofa in [image, images/fabrics/moss.jpg, 28|28, style=swatch, alt=\"Moss boucle swatch\"] moss boucle" }
]
}
}

Image in a paragraph​

{ "p": "[image, images/logo.png, 120|40]" }

Image with surrounding text​

{ "p": "Approved by [image, images/signature.png, 80|30] on March 30, 2026." }

Small inline icon​

{ "p": "[image, images/check-icon.png, 12|12] Shipment verified and dispatched." }

Images in table cells​

{
"table": {
"widths": [1, 3, 1],
"rows": [
[
{ "p": "[image, images/product-a.png, 50|50]" },
{ "p": "[b]Product A[/b][br]Industrial-grade shipping container, 40ft standard." },
{ "p": "$1,200" }
],
[
{ "p": "[image, images/product-b.png, 50|50]" },
{ "p": "[b]Product B[/b][br]Refrigerated container, 20ft with temperature control." },
{ "p": "$2,800" }
]
]
}
}

Images in columns layouts​

{
"columns": {
"widths": [1, 2],
"gap": 20,
"rows": [
[
{ "image": { "src": "images/warehouse.png", "alt": "The Chicago distribution center", "width": 150 } }
],
[
{ "p": "[b]Chicago Distribution Center[/b]" },
{ "p": "Our flagship facility in the Midwest handles over 50,000 packages per day with automated sorting and climate-controlled storage." }
]
]
}
}

Images in headers​

Images are commonly used in headers for company logos. Combine with [tab] to position the logo on the left and text on the right.

{
"header": {
"content": [
{
"p": "[image, images/logo.png, 80|24][tab, 350, 0]ShipForge Logistics"
}
],
"hr": {
"borderStyle": "solid",
"height": 0.5,
"color": "#CCCCCC"
}
}
}

Images with data references​

Image paths can include $data references for dynamic image selection.

{ "p": "[image, $data.company.logoPath, 100|30]" }

Full example​

{
"document": {
"images": {
"logo": { "src": "images/shipforge-logo.png", "alt": "ShipForge Logistics" }
},
"styles": {
"title": { "fontSize": 18, "fontWeight": "bold" },
"body": { "fontSize": 10, "color": "#333333" }
},
"header": {
"content": [
{ "p": "[image, logo, 90|28][tab, 380, 0][color, #999999]Shipping Report[/color]" }
],
"hr": { "borderStyle": "solid", "height": 0.5, "color": "#E0E0E0" },
"skipPages": [1]
},
"content": [
{ "image": { "src": "logo", "alt": "ShipForge Logistics", "width": 180 } },
{ "p": "Quarterly Shipping Report", "style": "title" },
{ "p": "Below is a summary of our hub locations and their current throughput.", "style": "body" },
{
"table": {
"widths": [1, 2, 2],
"rows": [
[
{ "th": "" },
{ "th": "Location" },
{ "th": "Packages/Day" }
],
[
{ "p": "[image, images/flag-us.png, 24|16]" },
{ "p": "Chicago, IL" },
{ "p": "52,000" }
],
[
{ "p": "[image, images/flag-ca.png, 24|16]" },
{ "p": "Toronto, ON" },
{ "p": "34,000" }
],
[
{ "p": "[image, images/flag-gb.png, 24|16]" },
{ "p": "London, UK" },
{ "p": "47,000" }
]
]
}
}
]
}
}