# Pages and Elements

> Create PDF pages, enumerate editable elements, and control element geometry and stacking.

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

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

- Requested language: `en-US`

- Content language: `en-US`

- Documentation version: `1.0.0-rc.0`

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

---

`FPdf` owns pages, and each `FPdfPage` exposes the durable editable overlays placed on that page.

## Read and insert pages

Page indexes are zero-based. `insertPage(index?)` inserts at an index or appends when the index is omitted; an empty document uses A4 dimensions.

```ts
const pdf = univerAPI.getActivePdf()

if (!pdf) {
  throw new Error('No active PDF')
}

const page = pdf.getPageByIndex(0) ?? pdf.insertPage()
const pages = pdf.getPages()
const samePage = pdf.getPageById(page.getId())
```

## Enumerate editable elements

`getElements()` returns editable overlays in z-order. It does not return native objects from the imported PDF.

```ts
const elements = page.getElements()
const [firstElement] = elements
const sameElement = firstElement ? page.getElementById(firstElement.getId()) : null
```

Use the typed getters when you need a specialized wrapper: `getTextBoxes()`, `getParagraphs()`, `getLists()`, `getTables()`, `getImages()`, `getDividers()`, and `getAnnotations()`.

## Transform and remove elements

Facade placement uses PDF points. Snapshot geometry returned by `getData()` uses core PDF units, so update placement through the Facade methods.

```ts
const [element] = page.getElements()

if (element) {
  element
    .setPosition(36, 72)
    .setSize(288, 144)
    .setRotation(5)
    .setVisible(true)
    .setLocked(false)
    .bringToFront()
}
```

Use `remove()` to delete an editable element. After removal, do not reuse the stale wrapper.
