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


@interface PDFPage : NSObject


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.


Initializing a Page

- initWithDocument:

Initializer for subclasses of PDFPage.

- initWithImage:

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

Getting Information About a Page


Returns the PDFDocument object with which the page is associated.


Returns the label for the page.

- boundsForBox:

Returns the bounds for the specified PDF display box.

- setBounds:forBox:

Sets the bounds for the specified box.


Sets the rotation angle for the page in degrees.

Working with Annotations


Returns an array containing the page’s annotations.


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

- addAnnotation:

Adds the specified annotation object to the page.

- removeAnnotation:

Removes the specified annotation from the page.

- annotationAtPoint:

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

Rendering Pages

- drawWithBox:

Draws the page within the specified box.

- transformContextForBox:

Transforms the current context, given the specified box.


Working with Textual Content


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


Returns an NSString object representing the text on the page.


Returns an NSAttributedString object representing the text on the page.

- characterBoundsAtIndex:

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

- characterIndexAtPoint:

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

Working with Selections

- selectionForRect:

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

- selectionForWordAtPoint:

Returns the whole word that includes the specified point.

- selectionForLineAtPoint:

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

- selectionFromPoint:toPoint:

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

- selectionForRange:

Returns the text contained within the specified range.

Supporting Types


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.


Instance Properties


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


Inherits From

Conforms To

See Also

Content Model


An object that represents PDF data or a PDF file and defines methods for writing, searching, and selecting PDF data.


A PDFOutline object is an element in a tree-structured hierarchy that can represent the structure of a PDF document.


A PDFSelection object identifies a contiguous or noncontiguous selection of text in a PDF document.