Skip to main content
The rules array is how you style a Blink PDF document: surgical presentation rules over standard Markdown nodes. Each rule selects a set of nodes and sets presentation properties on them.
The rules schema is large — 18 selector axes and 60+ settable properties. This page covers the model and the common cases; the API Reference → Render request body is generated from the server’s OpenAPI contract and is always authoritative for every axis, property, enum, and constraint. Use POST /v1/render/validate to check a rule set before spending a render, and GET /v1/style-targets for the machine-readable vocabulary.

The shape of a rule

object[]
Up to 256 presentation rules. Each rule is an object with:

Selecting nodes

select chooses which nodes a rule touches. The selectable node types are heading, paragraph, list, listItem, blockquote, table, codeBlock, thematicBreak, image, plus the inline types strong, emphasis, delete, mark, subscript, superscript, link, and inlineCode. Common selector axes: An empty select: {} matches every node — useful for a document-wide default that more specific rules override.

Setting presentation

set applies properties to matched nodes. Compatibility depends on whether the matched node is a block or inline run; POST /v1/render/validate flags incompatible combinations. Frequently used properties, grouped by purpose:

Text and color

Boxes and breaks

background, border, borderLeft, borderRadius, and padding draw boxes around blocks (a borderLeft is the classic blockquote accent). pageBreakBefore, keepWithNext, minLinesAfter, and policy control pagination — keep a heading with its first lines, or force a section onto a new page.

Lists

marker, orderedMarker, unorderedMarker, and markerByDepth choose counters and bullets (builtin formats like decimal or upper-roman, builtin bullets like disc/square/dash/arrow, or any literal string). indent, gutter, and spacing (tight/loose) tune layout.

Code blocks

syntaxHighlight turns on token coloring, theme picks a palette (crisp-studio-light, charcoal-midnight), and syntaxColors overrides individual token roles. lineNumbers, lineNumberColor, and languageLabel add gutters and a language tag.

Tables

borders (none/grid/outer/header or a per-edge object), headerBackground, stripe (zebra rows), widths, and repeatHeaderOnPageBreak. Pagination and overflow within a table are controlled by:
  • rowSplit — whether a tall row may split across a page break.
  • cell — per-cell valign, textWrap (normal/break-word/anywhere), and padding, plus block-axis overflow: cell.blockOverflow (clip/shrink/split/ellipsis) with a cell.maxHeight ceiling. maxHeight is required for clip and shrink to have any effect; without it both are no-ops.

Images

width, maxWidth, height, fit (none/contain/cover/fill), shadow, mask (clip to a shape, rect, path, or alpha image), and overlay (stamp an image or text on top). Box treatments (border, borderRadius, background) apply to images too.
To target images by position or exact URL without a select rule, use the top-level imageOverrides field — it takes the same image style vocabulary and merges over styles.image for matching images only.

Example: image card with a border and shadow

Heading numbering

The numbering object adds automatic section numbers to headings. It is opt-in: counters reset on the next deeper heading and propagate through the document.
object
Auto-numbering policy. Requires enabled: true.

PDF outline (bookmarks)

The outline object controls the PDF’s navigation bookmarks. When omitted, an outline is emitted with the default depth range [1, 6] for any document containing headings.
object
PDF outline (bookmarks).
To drop a single heading from the outline without changing the depth range, add a rule: { "select": { "type": "heading", "text": { "contains": "Appendix" } }, "set": { "outline": false } }.