# Images and Dividers

> Insert managed images, update image resources, and add vector dividers to PDF pages.

- Human documentation: [https://docs.univer.ai/guides/pdfs/features/core/images-and-dividers](https://docs.univer.ai/guides/pdfs/features/core/images-and-dividers)

- Agent Markdown: [https://docs.univer.ai/guides/pdfs/features/core/images-and-dividers.md](https://docs.univer.ai/guides/pdfs/features/core/images-and-dividers.md)

- Requested language: `en-US`

- Content language: `en-US`

- Documentation version: `1.0.0-rc.0`

- Source: [pdfs/features/core/images-and-dividers.mdx](https://github.com/dream-num/documentation/blob/dev/content/guides/pdfs/features/core/images-and-dividers.mdx)

---

PDF images are managed editable resources. Use `insertImageAsync()` for a URL, UUID, base64 string, or blob source, or use the detached builder for staged insertion.

## Insert an image

```ts
const image = await page.insertImageAsync(
  'https://example.com/assets/signature.png',
  {
    left: 36,
    top: 36,
    width: 144,
    height: 72,
    opacity: 0.9,
  }
)

image.setRotation(-4).bringToFront()
```

Automatic source detection recognizes absolute `http` and `https` URLs. Relative URL paths are not accepted as URL sources; use an absolute URL, a valid managed-resource UUID, or base64 data.

## Use the image builder

```ts
const imageInfo = page
  .newImage()
  .setSource('https://example.com/assets/chart.png')
  .setAbsolutePosition(216, 36)
  .setSize(240, 135)
  .setOpacity(0.85)
  .build()

const chart = page.insertImage(imageInfo)
```

`build()` is detached and does not modify the PDF. Pass its result to `insertImage()`. Update an existing managed image through its live `setSource()`, transform, crop, and opacity methods.

## Add a divider

```ts
const divider = page.insertDivider({
  left: 36,
  top: 144,
  width: 420,
  strokeWidth: 1,
})

divider.setStroke({
  width: 2,
  color: '#3366ff',
})
```

Divider geometry and stroke lengths use PDF points. `getStroke()` returns a detached snapshot, and `setStroke()` replaces the stroke without changing geometry.

`FPdfImage` also exposes `getSource()`, `getImageSourceType()`, `setSource()`, `getCrop()`, `setCrop()`, `getOpacity()`, `setOpacity()`, and `remove()`. Image opacity must be between `0` and `1`.
