Components

Image

The <Image> component renders an image from a file path, URL, or data source. Supports PNG, JPEG, and SVG formats.

Props

PropTypeDefaultDescription
src*string | BufferImage source. Path, URL, base64 data URI, or Buffer.
styleStyleStandard style object. Common: width, height, objectFit, borderRadius.
fixedbooleanRepeat on every page.
debugbooleanShow debug borders.
cachebooleantrueWhether to cache the decoded image.

Source Types

vue
<template>
  <Document>
    <Page size="A4">
      <!-- Local path -->
      <Image src="/assets/logo.png" />

      <!-- Remote URL -->
      <Image src="https://example.com/photo.jpg" />

      <!-- Base64 Data URI -->
      <Image src="data:image/svg+xml;base64,PHN2ZyB..." />
    </Page>
  </Document>
</template>

Object Fit

vue
<template>
  <Document>
    <Page size="A4">
      <Image
        src="/photo.jpg"
        :style="{
          width: 200,
          height: 200,
          objectFit: 'cover',
          objectPositionX: 0.5,
          objectPositionY: 0.3,
          borderRadius: 8,
        }"
      />
    </Page>
  </Document>
</template>