---
title: "layOutContentsPage"
version: "0.9.0"
url: "https://docs.laminapdf.com/reference/sdk/functions/layoutcontentspage/"
---

# layOutContentsPage

```ts
function layOutContentsPage(listing, fonts?): ContentsPage;
```

Defined in: [packages/sdk/src/contents.ts:109](https://github.com/laudebugs/laminapdf/blob/v0.9.0/packages/sdk/src/contents.ts#L109)

Lays out the contents page of `listing` as a document of its own, in `fonts`: the heading, then
each entry indented by its level with dot leaders to its label. Needs the text module loaded
(`init({ text: true })`); the document the listing came from can be open in any module.

## Parameters

### listing

[`ContentsListing`](/reference/sdk/interfaces/contentslisting.md)

### fonts?

[`ContentsFonts`](/reference/sdk/interfaces/contentsfonts.md) = `{}`

## Returns

[`ContentsPage`](/reference/sdk/interfaces/contentspage.md)

## Throws

[LaminaPdfError](/reference/sdk/classes/laminapdferror.md) `text-module-not-loaded`; `font-not-embedded` for the default
font on a file that claims PDF/A or PDF/UA-1; `missing-glyph` for a title no font can draw.

## Since

0.5.0
