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 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:

PropTypeDefaultDescription
idstringNoneMakes the node a named destination for #id links and page-number resolution.
fixedbooleanfalseRepeats the node on every page of its flow.
breakbooleanfalseForces a page break before the node.
minPresenceAheadnumber0Minimum space in points that must follow, or the node moves to the next page.
debugbooleanfalseDraws the node's layout box for debugging.
stylePdfStyleValueNoneA 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.

PropTypeDefaultDescription
title, author, subject, keywordsstringNoneInfo-dictionary metadata.
creator, producerstring'nuxt-pdf'Info-dictionary producer metadata.
languagestringNoneDocument language tag.
creationDateDateCurrent render dateInfo-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'NoneReader 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

PropTypeDefaultDescription
sizePdfPageSizeName | [w, h] | { width, height }'A4'Uppercase named size or explicit dimensions. See Page sizes.
orientation'portrait' | 'landscape''portrait'Page orientation.
dpinumber72DPI used for px dimensions.
wrapbooleantruePaginates content. false grows the page to fit.

Plus the base and bookmark props.

PdfView

The flexbox container. Base and bookmark props, plus:

PropTypeDefaultDescription
wrapbooleantrueAllows 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:

PropTypeDefaultDescription
wrapbooleantrueAllows text to split across pages.
widowsnumber2Minimum lines kept together at a page top.
orphansnumber2Minimum lines kept together at a page bottom.
render({ pageNumber, totalPages, subPageNumber, subPageTotalPages }) => string | number | null | undefinedNoneSynchronous dynamic text.
hyphenationCallback(word: string) => string[]Engine defaultReturns custom hyphenation break points.

Inside PdfSvg, it instead accepts:

PropTypeDefaultDescription
x, yPdfSvgLengthRequiredSVG text coordinates.
fillstringNoneDirect SVG text paint color.
stylePdfStyleValueNoneText metrics such as font family and size. color is not SVG paint.
hyphenationCallback(word: string) => string[]Engine defaultReturns 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:

PropTypeDefaultDescription
srcPdfImageSourceRequiredImage source.

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

Base props (no bookmark), plus:

PropTypeDefaultDescription
hrefstringRequiredExternal https: or mailto: URL, or a #id internal destination.
wrapbooleantrueAllows the link to split across pages.
hitSlop{ top?, right?, bottom?, left? }NoneExpands 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 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:

AreaExports
SharedPdfBaseProps, PdfBookmark
Document flowPdfDocumentProps, PdfPageProps, PdfViewProps, PdfTextProps, PdfImageProps, PdfLinkProps, PdfNoteProps
ImagesPdfImageSource
Page dimensionsPdfPageDimension, PdfPageSize, PdfPageSizeName, PdfPageUnit
SVG containersPdfSvgProps, PdfGProps, PdfDefsProps, PdfClipPathProps
SVG shapesPdfPathProps, PdfRectProps, PdfCircleProps, PdfEllipseProps, PdfLineProps, PdfPolylineProps, PdfPolygonProps
SVG gradients and textPdfLinearGradientProps, PdfRadialGradientProps, PdfStopProps, PdfTspanProps
SVG valuesPdfSvgNumber, PdfSvgLength, PdfSvgPresentationProps, PdfSvgTransform, PdfSvgTransformOperation