Skip to main content

Watermarks

Watermarks are page chrome. They render across every page, behind the body content, without affecting flow — in Word they anchor as background objects (still individually editable). The same JSON renders in both formats, with these recorded differences in the DOCX:

  • skipPages can only take a mark off a leading page, such as a cover: the DOCX anchors a mark in a header that serves its whole section. For any other page, give a section break its own watermarks (see Per-section watermarks).
  • A turned mark of rich content turns only in a reader of Word's newer drawing shapes; the older fallback stands upright.
  • A tiled mark may be thinned differently per page, since a DOCX header serves every page of its section.
  • A turned text mark is drawn as WordArt, its glyphs narrower and taller than the PDF's.

A watermark's content is a full content node — not just text or an image. Anything the body vocabulary can express works here: paragraphs and headings with Shortcodes, a th or td cell keeping its borders, lists, tables, columns, an hr, complete SVG graphics with textPath rings and positioned barcodes, a reusable component stamped via use, and even form fields. "DRAFT in gray" is the simplest watermark, not the extent of them: decorative page frames, edge sidebars, certification seals and repeating brand patterns are all watermarks.

In tagged output (a ua-* claim) every mark is an artifact: it is left out of the reading order and the structure tree, so a screen reader never announces "DRAFT" between two paragraphs.

Live example​

A real-world Mutual NDA with a DRAFT watermark layered behind page content. Open Template to see the JSON.

Schema​

Watermarks live at the root of the document definition as an array — they apply to the document as a whole, not to a particular position in the content flow.

{
"document": {
"watermarks": [
{
"content": { "p": "DRAFT" },
"angle": -30,
"repeat": false,
"style": "draft"
}
],
"content": [ { "p": "Report body." } ]
}
}
PropertyTypeDefaultDescription
contentContent—One content node — a paragraph or heading, a cell, a list, a table, columns, an hr, an svg block, a field, or Shortcodes inside text ([image, …], [barcode, …]). Same content vocabulary as body content. Required.
anglenumber0Rotation in degrees. Positive turns counter-clockwise, negative clockwise. The content rotates around its own visual center.
repeatbooleanfalsetrue = tile across the page using spacing as the step, from the bottom-left corner, as CSS background-repeat: repeat does: the tiles cover the whole sheet, and the page edge clips the last column and row when the step does not divide it. false = single instance; placement comes from spacing if provided, otherwise centered: a plain mark (no angle, repeat or spacing) in the content area under the default scope: content, or on the whole sheet with scope: page; a mark with an angle, repeat or spacing is always placed against the page.
spacing[x, y]—In points. Meaning depends on repeat: tile step when repeat: true, explicit page-coordinate placement of the visual center when repeat: false. Omit or use [0, 0] for centered placement.
stylestring—Named style applied to the watermark content (font size, opacity, color; see the style keys).
scopepage | contentcontentWhat a plain mark is placed against: page, the whole sheet, or content, the area inside the margins. A mark with an angle, repeat or spacing is laid against the page whatever its scope.
skipPagesinteger[]—Page numbers, counted from 1, that the mark is left off: [1] keeps a cover clean. In a DOCX only leading pages can be skipped; see Per-section watermarks for the portable form.

Text watermark​

The most common shape — bold rotated text with low opacity behind the document body.

{
"document": {
"styles": {
"draft": { "fontSize": 96, "fontWeight": "bold", "color": "#CCCCCC", "opacity": 0.30 }
},
"watermarks": [
{
"content": { "p": "DRAFT" },
"angle": -30,
"repeat": false,
"style": "draft"
}
],
"content": [
{ "p": "Body content sits beneath the centered DRAFT mark." }
]
}
}

Image watermark​

The watermark content is just a paragraph — drop in an [image, …] Shortcode and it renders as an image watermark. Style provides the opacity for "faintness".

{
"document": {
"styles": {
"logoFaint": { "opacity": 0.15 }
},
"watermarks": [
{
"content": { "p": "[image, images/logos/acme.png, 240|72]" },
"angle": -30,
"repeat": false,
"style": "logoFaint"
}
],
"content": [ { "p": "Report body." } ]
}
}

SVG watermark — frames, seals, any graphic​

Because the content is a full content node, an entire svg graphic can be the watermark. A decorative page frame is four corner brackets in one graphic. A plain svg mark is fitted to the content area under the default scope: content, or to the whole sheet with scope: page:

{
"styles": { "bracket": { "stroke": "#B8860B", "strokeWidth": 2 } },
"watermarks": [
{
"content": {
"svg": {
"viewBox": [572, 752],
"children": [
{ "path": { "d": "M 0 40 L 0 0 L 40 0", "style": "bracket" } },
{ "path": { "d": "M 532 0 L 572 0 L 572 40", "style": "bracket" } },
{ "path": { "d": "M 572 712 L 572 752 L 532 752", "style": "bracket" } },
{ "path": { "d": "M 40 752 L 0 752 L 0 712", "style": "bracket" } }
]
}
},
"repeat": false
}
]
}

Everything an svg block can draw is available — textPath rings, shape shortcuts, positioned barcode elements, and use: declare a decorative frame or certification seal once as a component and stamp it into the watermark of every template that needs it.

Repeating tile pattern​

For internal-doc branding, tile a small mark across the page.

{
"watermarks": [
{
"content": { "p": "[image, images/logos/acme.png, 120|60]" },
"spacing": [250, 200],
"angle": 0,
"repeat": true,
"style": "logoFaint"
}
]
}
Layoutrepeatspacing
Single, centeredfalseomitted or [0, 0]
Single, positionedfalse[centerX, centerY] in page points
Tiled across pagetrue[xStep, yStep] in page points

Positioned watermark — edge-mounted elements​

For control numbers, vertical sidebars, edge-mounted barcodes, and other elements anchored to a specific page region, set repeat: false and provide explicit page coordinates in spacing. The values are the visual center of the watermark content in page points (origin at bottom-left).

A vertical sidebar running down the left edge of a portrait LETTER page (612×792):

{
"watermarks": [
{
"content": {
"svg": {
"viewBox": [22, 620],
"children": [
{ "line": { "x1": 6, "y1": 14, "x2": 6, "y2": 606, "style": "edgeRule" } },
{ "textPath": {
"d": "M 14 606 L 14 14",
"text": "[caps]control no. dpa-doc-2026-0457 · scan to verify[/caps]",
"textAnchor": "middle",
"style": "edgeText"
} }
]
}
},
"repeat": false,
"spacing": [25, 396]
}
]
}

The SVG (22pt wide × 620pt tall) is anchored with its visual center at [25, 396] — 25pt from the page's left edge, page-center vertically. A mirror watermark with spacing: [587, 396] does the same on the right edge (612 − 25 = 587).

This works for any content shape — a barcode [barcode, code128, …] paragraph rotated with angle: 90 becomes a vertical edge barcode; a small text block at [306, 80] becomes a bottom-edge control number. A barcode beside text, in a list, a table or columns turns with the rest of the mark, and the DOCX stands every bar, digit and line where the PDF does.

achievement-certificate and void-check both ship live examples of this pattern.

Form fields in a mark​

A mark can be a form field, written as a block field node: a "Reviewer" box or a "checked" tick that sits at the same spot on every page. Each page gets its own widget. A plain name is one field; to give each page a field of its own, with a value of its own, put a page token in the name ($global.PAGE, $global.NUMPAGES or $global.SECTION, the only tokens a field name may hold):

{
"watermarks": [
{
"content": { "field": { "label": "Initials", "name": "initials_$global.PAGE", "width": 60, "height": 16 } },
"spacing": [540, 40],
"skipPages": [1]
}
]
}

Multiple watermarks & layering​

The array order is the z-order: the first watermark paints deepest, later ones above it — all beneath the body content. The full page stack, bottom to top: page background color → watermarks (in array order) → body content → page borders, headers and footers.

Layer a faint logo behind a bold DRAFT text overlay:

{
"watermarks": [
{
"content": { "p": "[image, images/logos/acme.png, 200|80]" },
"spacing": [300, 250],
"repeat": true,
"style": "logoFaint"
},
{
"content": { "p": "DRAFT" },
"angle": -35,
"repeat": false,
"style": "draftBold"
}
]
}

Per-section watermarks​

A section break can carry its own watermarks array, with three distinct states:

Section watermarksEffect
absentInherits the document-level watermarks.
[] (empty array)Suppresses watermarks for this section — clean cover or signature pages.
populatedReplaces the document-level set for this section.
{
"document": {
"watermarks": [ { "content": { "p": "DRAFT" }, "angle": -30, "style": "draft" } ],
"content": [
{ "h1": "Body under the DRAFT mark" },
{ "break": "section", "watermarks": [] },
{ "p": "This section renders clean — the empty array suppresses inheritance." },
{ "break": "section", "watermarks": [
{ "content": { "p": "CONFIDENTIAL ANNEX" }, "angle": -30, "style": "draft" } ] },
{ "p": "This annex carries its own mark instead." }
]
}
}

Dynamic watermark content​

Anywhere $data.* references appear (text, image src, even $data.<key> substitutions inside Shortcodes), they resolve when the document is composed, before layout, the same way they do in body content:

{
"watermarks": [
{
"content": { "p": "[image, $data.tenant.logoPath, 120|60]" },
"repeat": true,
"style": "logoFaint"
},
{
"content": { "p": "$data.classification" },
"repeat": false,
"style": "classification"
}
]
}

Style properties that matter for watermarks​

A mark's style takes the keys its content would take in the body. The ones that matter most:

PropertyDescription
fontSizeText size — typically large (60–120pt) for a single centered mark.
colorText color.
fontWeight / fontStylebold, italic, as on any text.
fontFamilyA family declared under fonts, or a built-in one.
opacity0.0–1.0 translucency. Most watermarks use 0.05–0.30.
letterSpacingTracking, for a spaced-out stamp.
textAlignAlignment of a mark's lines.
textRenderingModestroke draws outlined, hollow letters.
rotate / transformTurn or skew the mark's box, beside angle.
border, borderRadius, backgroundColor, paddingA framed stamp: the box keys apply to a mark as to any block (Box model, Borders).
clipPathCuts the mark to a shape (Paint).
{
"styles": {
"draft": { "fontSize": 96, "fontWeight": "bold", "color": "#94A3B8", "opacity": 0.25 },
"verified": { "fontSize": 80, "fontWeight": "bold", "color": "#15803D", "opacity": 0.35 },
"logoFaint": { "opacity": 0.15 }
}
}

What's next​

  • SVG — for diagrams and decorative chrome that reserve flow space instead of overlaying every page.
  • Columns — multi-column layouts inside the document body.