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
Styling and layout.
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 | Default | Description |
|---|---|---|---|
id | string | None | Makes the node a named destination for #id links and page-number resolution. |
fixed | boolean | false | Repeats the node on every page of its flow. |
break | boolean | false | Forces a page break before the node. |
minPresenceAhead | number | 0 | Minimum space in points that must follow, or the node moves to the next page. |
debug | boolean | false | Draws the node's layout box for debugging. |
style | PdfStyleValue | None | A style object or nested array. false, null, and undefined entries are ignored. |
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 | Default | Description |
|---|---|---|---|
title, author, subject, keywords | string | None | Info-dictionary metadata. |
creator, producer | string | 'nuxt-pdf' | Info-dictionary producer metadata. |
language | string | None | Document language tag. |
creationDate | Date | Current render date | Info-dictionary creation date. |
pdfVersion | '1.3' through '1.7' or '1.7ext3' | '1.3' | PDF version written to the catalog. |
pageLayout | 'singlePage' | 'oneColumn' | 'twoColumnLeft' | 'twoColumnRight' | 'twoPageLeft' | 'twoPageRight' | None | Reader page layout. |
Reader page mode, encryption passwords, and PDF permission flags are not public props. Their serialized behavior is not part of the current public contract.
modificationDate is also 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 | Default | Description |
|---|---|---|---|
size | PdfPageSizeName | [w, h] | { width, height } | 'A4' | Uppercase named size or explicit dimensions. See Page sizes. |
orientation | 'portrait' | 'landscape' | 'portrait' | Page orientation. |
dpi | number | 72 | DPI used for px dimensions. |
wrap | boolean | true | Paginates content. false grows the page to fit. |
Plus the base and bookmark props.
PdfView
The flexbox container. Base and bookmark props, plus:
| Prop | Type | Default | Description |
|---|---|---|---|
wrap | boolean | true | Allows the view to 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 | Default | Description |
|---|---|---|---|
wrap | boolean | true | Allows text to split across pages. |
widows | number | 2 | Minimum lines kept together at a page top. |
orphans | number | 2 | Minimum lines kept together at a page bottom. |
render | ({ pageNumber, totalPages, subPageNumber, subPageTotalPages }) => string | number | null | undefined | None | Synchronous dynamic text. |
hyphenationCallback | (word: string) => string[] | Engine default | Returns custom hyphenation break points. |
Inside PdfSvg, it instead accepts:
| Prop | Type | Default | Description |
|---|---|---|---|
x, y | PdfSvgLength | Required | SVG text coordinates. |
fill | string | None | Direct SVG text paint color. |
style | PdfStyleValue | None | Text metrics such as font family and size. color is not SVG paint. |
hyphenationCallback | (word: string) => string[] | Engine default | Returns 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 | Default | Description |
|---|---|---|---|
src | PdfImageSource | Required | Image source. |
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 | Default | Description |
|---|---|---|---|
href | string | Required | External https: or mailto: URL, or a #id internal destination. |
wrap | boolean | true | Allows the link to split across pages. |
hitSlop | { top?, right?, bottom?, left? } | None | 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
Supported behavior and limitations.
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.
Exported primitive types
Import prop and value types from @lupinum/nuxt-pdf when you type reusable
document components:
| Area | Exports |
|---|---|
| Shared | PdfBaseProps, PdfBookmark |
| Document flow | PdfDocumentProps, PdfPageProps, PdfViewProps, PdfTextProps, PdfImageProps, PdfLinkProps, PdfNoteProps |
| Images | PdfImageSource |
| Page dimensions | PdfPageDimension, PdfPageSize, PdfPageSizeName, PdfPageUnit |
| SVG containers | PdfSvgProps, PdfGProps, PdfDefsProps, PdfClipPathProps |
| SVG shapes | PdfPathProps, PdfRectProps, PdfCircleProps, PdfEllipseProps, PdfLineProps, PdfPolylineProps, PdfPolygonProps |
| SVG gradients and text | PdfLinearGradientProps, PdfRadialGradientProps, PdfStopProps, PdfTspanProps |
| SVG values | PdfSvgNumber, PdfSvgLength, PdfSvgPresentationProps, PdfSvgTransform, PdfSvgTransformOperation |