Docs/PdfImage
data@pdfcn-vue/pdf-image

PdfImage

Image with fit modes and caption support.

Installation

Terminal

npx shadcn-vue@latest add @pdfcn-vue/pdf-image

Usage

Example

<PdfImage src="/logo.png" :width="120" fit="contain" />

Props

PropTypeDefaultDescription
srcstring—Image source (URL or data URI).
widthnumber—Render width in points.
heightnumber—Render height in points.
fit'contain' | 'cover' | 'fill''contain'Image fit mode.
captionstring—Optional caption.

Live preview

The gallery uses a shared document. Change its theme in the theme builder to compare tokens.

PdfImage in a document
Rendered with Forme in your browser.
Browser render

Rendering the PDF…

Vue SFC → Uint8Array

Source files

Registry paths
Files installed under components/pdf.
  • forme/components/PdfImage.vue
  • forme/components/pdf-image.types.ts

Edit the theme tokens

Try the theme builder