<!--
{
  "availability" : [
    "iOS: 11.0.0 -",
    "iPadOS: 11.0.0 -",
    "macCatalyst: 13.1.0 -",
    "macOS: 10.4.0 -",
    "tvOS: 11.0.0 -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "PDFKit",
  "identifier" : "/documentation/PDFKit/PDFPage",
  "metadataVersion" : "0.1.0",
  "role" : "Class",
  "symbol" : {
    "kind" : "Class",
    "modules" : [
      "PDFKit"
    ],
    "preciseIdentifier" : "c:objc(cs)PDFPage"
  },
  "title" : "PDFPage"
}
-->

# PDFPage

`PDFPage`, a subclass of `NSObject`, defines methods used to render PDF pages and work with annotations, text, and selections.

```
class PDFPage
```

## Overview

`PDFPage` objects are flexible and powerful. With them you can render PDF content onscreen or to a printer, add annotations, count characters, define selections, and get the textual content of a page as an `NSString` object.

Your application instantiates a `PDFPage` object by asking for one from a `PDFDocument` object.

For simple display and navigation of PDF documents within your application, you don’t need to use `PDFPage`. You need only use `PDFView`.

## Topics

### Initializing a Page

[`init(image:)`](/documentation/PDFKit/PDFPage/init(image:))

Creates a new `PDFPage` object and initializes it with the specified `NSImage` object.

### Getting Information About a Page

[`document`](/documentation/PDFKit/PDFPage/document)

Returns the `PDFDocument` object with which the page is associated.

[`label`](/documentation/PDFKit/PDFPage/label)

Returns the label for the page.

[`bounds(for:)`](/documentation/PDFKit/PDFPage/bounds(for:))

Returns the bounds for the specified PDF display box.

[`setBounds(_:for:)`](/documentation/PDFKit/PDFPage/setBounds(_:for:))

Sets the bounds for the specified box.

[`rotation`](/documentation/PDFKit/PDFPage/rotation)

Sets the rotation angle for the page in degrees.

### Working with Annotations

[`annotations`](/documentation/PDFKit/PDFPage/annotations)

Returns an array containing the page’s annotations.

[`displaysAnnotations`](/documentation/PDFKit/PDFPage/displaysAnnotations)

Returns a Boolean value indicating whether annotations are displayed for the page.

[`addAnnotation(_:)`](/documentation/PDFKit/PDFPage/addAnnotation(_:))

Adds the specified annotation object to the page.

[`removeAnnotation(_:)`](/documentation/PDFKit/PDFPage/removeAnnotation(_:))

Removes the specified annotation from the page.

[`annotation(at:)`](/documentation/PDFKit/PDFPage/annotation(at:))

Returns the annotation, if there is one, at the specified point.

### Rendering Pages

[`draw(with:)`](/documentation/PDFKit/PDFPage/draw(with:))

Draws the page within the specified box.

[`transformContext(for:)`](/documentation/PDFKit/PDFPage/transformContext(for:))

Transforms the current context, given the specified box.

### Working with Textual Content

[`numberOfCharacters`](/documentation/PDFKit/PDFPage/numberOfCharacters)

Returns the number of characters on the page, including whitespace characters.

[`string`](/documentation/PDFKit/PDFPage/string)

Returns an `NSString` object representing the text on the page.

[`attributedString`](/documentation/PDFKit/PDFPage/attributedString)

Returns an `NSAttributedString` object representing the text on the page.

[`characterBounds(at:)`](/documentation/PDFKit/PDFPage/characterBounds(at:))

Returns the bounds, in page space, of the character at the specified index.

[`characterIndex(at:)`](/documentation/PDFKit/PDFPage/characterIndex(at:))

Returns the character index value for the specified point in page space.

### Working with Selections

[`selection(for:)`](/documentation/PDFKit/PDFPage/selection(for:)-2ckpi)

Returns the text enclosed within the specified rectangle, expressed in page (user) coordinates.

[`selectionForWord(at:)`](/documentation/PDFKit/PDFPage/selectionForWord(at:))

Returns the whole word that includes the specified point.

[`selectionForLine(at:)`](/documentation/PDFKit/PDFPage/selectionForLine(at:))

Returns the whole line of text that includes the specified point.

[`selection(from:to:)`](/documentation/PDFKit/PDFPage/selection(from:to:))

Returns the text between the two specified points in page space.

[`selection(for:)`](/documentation/PDFKit/PDFPage/selection(for:)-20y9d)

Returns the text contained within the specified range.

### Supporting Types

[`PDFDisplayBox`](/documentation/PDFKit/PDFDisplayBox)

The following box types may be used with `PDFPage` drawing and bounds-setting methods. See the Adobe PDF Specification for more information on box types, units, and coordinate systems.

[`PDFDisplayDirection`](/documentation/PDFKit/PDFDisplayDirection)

### Type Aliases

[`PDFPage.ImageInitializationOption`](/documentation/PDFKit/PDFPage/ImageInitializationOption)

### Initializers

[`init()`](/documentation/PDFKit/PDFPage/init())

[`init(image:options:)`](/documentation/PDFKit/PDFPage/init(image:options:))

### Instance Properties

[`dataRepresentation`](/documentation/PDFKit/PDFPage/dataRepresentation)

Returns the PDF data (that is, a PDF document) representing this page. This method does not preserve external page links.

[`pageRef`](/documentation/PDFKit/PDFPage/pageRef)

### Instance Methods

[`draw(with:to:)`](/documentation/PDFKit/PDFPage/draw(with:to:))

[`thumbnail(of:for:)`](/documentation/PDFKit/PDFPage/thumbnail(of:for:))

[`transform(_:for:)`](/documentation/PDFKit/PDFPage/transform(_:for:))

[`transform(for:)`](/documentation/PDFKit/PDFPage/transform(for:))



---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)