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:
| Prop | Type | Description |
|---|---|---|
id | string | Makes the node a named destination for #id links and page-number resolution |
fixed | boolean | Repeat the node on every page of its flow |
break | boolean | Force a page break before the node |
minPresenceAhead | number | Minimum space (pt) that must follow, or the node moves to the next page |
debug | boolean | Draw the node's layout box for debugging |
style | PdfStyleValue | A 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.
| Prop | Type | Description |
|---|---|---|
title, author, subject, creator, keywords, producer | string | Info-dictionary metadata |
language | string | Document language tag |
creationDate | Date | Standards-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
| Prop | Type | Description |
|---|---|---|
size | PdfPageSizeName | [w, h] | { width, height } | A known page name, or explicit numeric/unit dimensions (pt, in, mm, cm, px) |
orientation | 'portrait' | 'landscape' | Page orientation |
dpi | number | DPI for px-based sizing |
wrap | boolean | Whether 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:
| Prop | Type | Description |
|---|---|---|
wrap | boolean | Whether 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:
| Prop | Type | Description |
|---|---|---|
wrap | boolean | Whether the text may split across pages |
widows | number | Minimum lines kept together at a page top |
orphans | number | Minimum lines kept together at a page bottom |
render | ({ pageNumber, totalPages, subPageNumber, subPageTotalPages }) => string | number | null | undefined | Synchronous dynamic text |
hyphenationCallback | (word: string) => string[] | Custom hyphenation break points |
Inside PdfSvg, it instead accepts:
| Prop | Type | Description |
|---|---|---|
x, y | PdfSvgLength | Both are required SVG text coordinates |
fill | string | Direct SVG text paint color |
style | PdfStyleValue | Text 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:
| Prop | Type | Description |
|---|---|---|
src / source | PdfImageSource | Exactly 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? }.
PdfLink
Base props (no bookmark), plus:
| Prop | Type | Description |
|---|---|---|
src / href | string | Exactly one target; an external URL or #id internal destination |
wrap | boolean | Whether 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:
| Prop | Type |
|---|---|
fill, stroke | string |
fillOpacity, strokeOpacity | PdfSvgLength (0 to 1 or 0% to 100%) |
strokeWidth | PdfSvgNumber (non-negative) |
strokeLinecap | 'butt' | 'round' | 'square' |
strokeLinejoin | 'miter' | 'round' | 'bevel' |
transform | PdfSvgTransform. One to three unitless translate(...) or rotate(...) operations. |
clipPath | string with the value url(#id) |
Geometry props
| Component | Own props |
|---|---|
PdfSvg | viewBox, width, height, plus page-flow style (not SVG presentation) |
PdfG | (presentation props only) |
PdfPath | d (required) |
PdfRect | x, y, width (required), height (required), rx, ry |
PdfCircle | cx, cy, r (required) |
PdfEllipse | cx, cy, rx (required), ry (required) |
PdfLine | x1, y1, x2, y2 (all required) |
PdfPolyline / PdfPolygon | points (required) |
PdfDefs | None. It holds definitions that other elements can reference. |
PdfClipPath | id (required) |
PdfLinearGradient | id (required), x1, y1, x2, y2 |
PdfRadialGradient | id (required), cx, cy, r, fx, fy |
PdfStop | offset (required), stopColor (required), stopOpacity |
PdfTspan | x, 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.