# 텍스트와 목록

> 텍스트 상자, 문단 블록 및 의미론적 PDF 목록을 삽입하고 편집합니다.

- Human documentation: [https://docs.univer.ai/ko-KR/guides/pdfs/features/core/text-and-lists](https://docs.univer.ai/ko-KR/guides/pdfs/features/core/text-and-lists)

- Agent Markdown: [https://docs.univer.ai/ko-KR/guides/pdfs/features/core/text-and-lists.md](https://docs.univer.ai/ko-KR/guides/pdfs/features/core/text-and-lists.md)

- Requested language: `ko-KR`

- Content language: `ko-KR`

- Documentation version: `1.0.4`

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

---

PDF 텍스트는 간단한 편집 가능 텍스트 상자, 스토리 기반 문단 프레임 또는 의미론적 목록으로 사용할 수 있습니다.

## 텍스트 상자

```ts
const textBox = page.insertTextBox({
  text: 'Quarterly review',
  left: 36,
  top: 36,
  width: 280,
  height: 48,
  fontSize: 20,
})

textBox.setTextStyle({ bold: true, fill: '#1d4ed8' })
textBox.setTextStyle({ italic: true }, { start: 0, end: 9 })
```

`setTextStyle(style, range?)`는 상자 전체 또는 시작을 포함하고 끝을 제외하는 UTF-16 범위에 스타일을 적용합니다.

## 문단

문단 블록에는 안정적인 ID가 있습니다. 텍스트, 스타일 또는 순서를 업데이트하기 전에 `getBlocks()`로 읽으세요.

```ts
const paragraph = page.insertParagraph({
  text: 'Release summary',
  left: 36,
  top: 108,
  width: 280,
  height: 96,
})

paragraph.appendBlock({
  text: 'Approved for publication',
  textStyle: { italic: true },
})

const [block] = paragraph.getBlocks()

if (block) {
  paragraph.setBlockStyle(block.id, { align: 'center' })
}
```

## 의미론적 목록

```ts
const list = page.insertList({
  text: 'Verify content',
  kind: univerAPI.Enum.PdfListKind.ORDERED,
  preset: univerAPI.Enum.PdfListPresetId.ORDERED_NUMBER_ALPHA,
  left: 36,
  top: 228,
  width: 280,
  height: 120,
})

list.insertItem(1, { text: 'Export final PDF' })
list.insertItem(2, { text: 'Archive source', level: 1 })
list.setStartNumber(3)
```

목록 수준은 `0`부터 `8`까지입니다. 수준을 높이려면 부모가 될 수 있는 앞선 항목이 필요하며 `setStartNumber()`는 순서 있는 목록에서만 사용할 수 있습니다.

텍스트 상자는 `getTextRuns()`, `getTextAnchor()`, `setTextAnchor()`도 제공합니다. 문단은 `insertBlock()`, `appendBlock()`, `setBlockText()`, `setBlockStyle()`, `removeBlock()`을 제공합니다.
