Skip to content

modern-pdf-lib


modern-pdf-lib / buildPageTree

Function: buildPageTree()

buildPageTree(pages, registry): PdfRef

Defined in: src/core/pdfCatalog.ts:158

Build the /Pages tree and individual /Page dictionaries.

This implementation uses a flat page tree (a single /Pages node) which is correct for documents with up to several thousand pages.

Parameters

pages

readonly PageEntry[]

Ordered list of page entries.

registry

PdfObjectRegistry

Object registry.

Returns

PdfRef

The indirect reference to the root /Pages node.

Released under the MIT License.