Skip to main content

Primitives

Prop tables for every document and SVG primitive, drawn from the shipped type definitions.

Every primitive is an auto-registered global component. The tables below are drawn from the shipped prop types. style values use Nuxt PDF's framework-owned PdfStyle contract, not CSS or the wider upstream stylesheet types (see Authoring).

The same surface is enforced after Vue mounts the tree. Each primitive has a closed runtime prop allowlist; unknown props, DOM/event attributes, and props used on the wrong primitive fail with PDF_TREE_INVALID rather than passing through or silently doing nothing.

Shared base props

PdfPage, PdfView, page-flow PdfText, PdfImage, PdfLink, and PdfNote share these:

PropTypeDescription
idstringMakes the node a named destination for #id links and page-number resolution
fixedbooleanRepeat the node on every page of its flow
breakbooleanForce a page break before the node
minPresenceAheadnumberMinimum space (pt) that must follow, or the node moves to the next page
debugbooleanDraw the node's layout box for debugging
stylePdfStyleValueA style object, or an array of them (falsy entries filtered)

PdfPage, PdfView, PdfText, and PdfImage additionally accept bookmark (string, or { title, expanded? }) to build the outline.

PdfDocument

The root. Carries document metadata; takes no base props.

PropTypeDescription
title, author, subject, creator, keywords, producerstringInfo-dictionary metadata
languagestringDocument language tag
creationDateDateStandards-compliant Info-dictionary creation date
pdfVersion'1.3' through '1.7' or '1.7ext3'PDF version written to the catalog
pageLayout'singlePage' | 'oneColumn' | 'twoColumnLeft' | 'twoColumnRight' | 'twoPageLeft' | 'twoPageRight'Reader page layout

Reader page mode, encryption passwords, and PDF permission flags are not public props. They are intentionally absent until their serialized behavior can be verified independently.

modificationDate is also intentionally absent. The pinned engine writes its upstream prop under a non-standard custom key rather than the PDF ModDate entry, so exposing it would promise metadata that common readers do not see.

When definePdf supplies title or language, that value is authoritative and overrides the corresponding PdfDocument prop. Without a definition value, the root prop is preserved as the rendered fallback. Nuxt PDF reapplies the authoritative values after each page-number update in a multi-pass render.

PdfPage

PropTypeDescription
sizePdfPageSizeName | [w, h] | { width, height }A known page name, or explicit numeric/unit dimensions (pt, in, mm, cm, px)
orientation'portrait' | 'landscape'Page orientation
dpinumberDPI for px-based sizing
wrapbooleanWhether content paginates (default true); false grows the page to fit

Plus the base and bookmark props.

PdfView

The flexbox container. Base and bookmark props, plus:

PropTypeDescription
wrapbooleanWhether the view may split across a page boundary

PdfText

The only container for text has two context-specific prop branches.

In normal page flow it accepts the base and bookmark props, plus:

PropTypeDescription
wrapbooleanWhether the text may split across pages
widowsnumberMinimum lines kept together at a page top
orphansnumberMinimum lines kept together at a page bottom
render({ pageNumber, totalPages, subPageNumber, subPageTotalPages }) => string | number | null | undefinedSynchronous dynamic text
hyphenationCallback(word: string) => string[]Custom hyphenation break points

Inside PdfSvg, it instead accepts:

PropTypeDescription
x, yPdfSvgLengthBoth are required SVG text coordinates
fillstringDirect SVG text paint color
stylePdfStyleValueText metrics such as font family and size; color is not SVG paint
hyphenationCallback(word: string) => string[]Custom hyphenation break points

SVG text rejects page-flow-only props such as id, bookmark, fixed, break, wrap, widows, orphans, and render.

PdfImage

Base and bookmark props, plus:

PropTypeDescription
src / sourcePdfImageSourceExactly one image source; the names are aliases and cannot be combined

PdfImageSource is a pdfs/assets-relative path, a Uint8Array/ArrayBuffer, { data, format: 'png' \| 'jpg' }, or { uri, format? }.

Base props (no bookmark), plus:

PropTypeDescription
src / hrefstringExactly one target; an external URL or #id internal destination
wrapbooleanWhether the link may split across pages
hitSlop{ top?, right?, bottom?, left? }Expands the clickable area

PdfNote

A sticky-note annotation. Base props only; its text comes from its content.


SVG primitives

SVG primitives render inside a PdfSvg. Paint, geometry, clipping, and transforms are direct props. PdfG and the shape primitives have no generic style prop, so there is no style-precedence path; kebab-case Vue attributes are normalized to the equivalent camelCase key. See SVG graphics.

PdfSvgNumber is a finite number or numeric string. PdfSvgLength additionally accepts a numeric percentage string where the individual prop permits it. strokeWidth is never a percentage. Non-negative geometry and unit-interval opacity/stop ranges are checked at runtime.

Shared SVG presentation props

Available on PdfG, PdfPath, PdfRect, PdfCircle, PdfEllipse, PdfLine, PdfPolyline, and PdfPolygon:

PropType
fill, strokestring
fillOpacity, strokeOpacityPdfSvgLength (0 to 1 or 0% to 100%)
strokeWidthPdfSvgNumber (non-negative)
strokeLinecap'butt' | 'round' | 'square'
strokeLinejoin'miter' | 'round' | 'bevel'
transformPdfSvgTransform. One to three unitless translate(...) or rotate(...) operations.
clipPathstring with the value url(#id)

Geometry props

ComponentOwn props
PdfSvgviewBox, width, height, plus page-flow style (not SVG presentation)
PdfG(presentation props only)
PdfPathd (required)
PdfRectx, y, width (required), height (required), rx, ry
PdfCirclecx, cy, r (required)
PdfEllipsecx, cy, rx (required), ry (required)
PdfLinex1, y1, x2, y2 (all required)
PdfPolyline / PdfPolygonpoints (required)
PdfDefsNone. It holds definitions that other elements can reference.
PdfClipPathid (required)
PdfLinearGradientid (required), x1, y1, x2, y2
PdfRadialGradientid (required), cx, cy, r, fx, fy
PdfStopoffset (required), stopColor (required), stopOpacity
PdfTspanx, y, fill only

Alternate gradient coordinate systems/transforms/inheritance and SVG preserveAspectRatio modes are not public props; see Conformance.

Each PdfSvg accepts at most one direct PdfDefs child. Definition ids are safe, unique, and scoped to that one SVG. fill="url(#id)" must resolve to a linear or radial gradient; clipPath="url(#id)" must resolve to a PdfClipPath. Missing, malformed, or incompatible references fail with PDF_TREE_INVALID.

Explicit zero has SVG semantics: zero fill opacity is transparent, zero stroke width removes the stroke instead of requesting a PDF hairline, and supported gradient coordinates remain zero. The engine repairs upstream truthiness fallbacks after layout and before serialization.