---
name: "PDF::API2::Basic::PDF::Pages"
section: "3pm"
platform: "linux"
package: "perl-pdf-api2"
version: "2.048-1"
release: "Arch Linux 2026-11-01"
platforms: ["linux"]
url: "https://new.carta.tech/PDF::API2::Basic::PDF::Pages"
---

# PDF::API2::Basic::PDF::Pages(3pm)

Low-level page tree object

## NAME

PDF::API2::Basic::PDF::Pages - Low-level page tree object

## DESCRIPTION

A Pages object is the parent to other pages objects or to page objects themselves.

## METHODS

### PDF::API2::Basic::PDF::Pages-\>new($pdf, $parent)

This creates a new Pages object in a PDF. Notice that `$parent` here is not the file context for the object but the parent pages object for this pages. If we are using this class to create a root node, then `$parent` should point to the file context, which is identified by not having a Type of Pages.  `$pdf` is the file object (or a reference to an array of file objects) in which to create the new Pages object.

### $p-\>find\_page($page\_number)

Returns the given page, using the page count values in the pages tree. Pages start at 0.

### $p-\>add\_page($page, $page\_number)

Inserts the page before the given `$page_number`. `$page_number` can be negative to count from the END of the document. -1 is after the last page. Likewise `$page_number` can be greater than the number of pages currently in the document, to append.

### @objects = $p-\>get\_pages()

Returns a list of page objects in the document in page order

### $p-\>find\_prop($key)

Searches up through the inheritance tree to find a property.

### $p-\>add\_font($pdf, $font)

Creates or edits the resource dictionary at this level in the hierarchy. If the font is already supported even through the hierarchy, then it is not added.

### $p-\>bbox($xmin, $ymin, $xmax, $ymax, \[$param\])

Specifies the bounding box for this and all child pages. If the values are identical to those inherited then no change is made. `$param` specifies the attribute name so that other 'bounding box'es can be set with this method.

### $p-\>proc\_set(@entries)

Ensures that the current resource contains all the entries in the proc\_sets listed. If necessary it creates a local resource dictionary to achieve this.

### $p-\>get\_top

Returns the top of the pages tree
