Class

PDFSelection

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

Declaration

@interface PDFSelection : NSObject

Topics

Initializing a Selection

- initWithDocument:

Returns an empty PDFSelection object.

Getting Information About a Selection

pages

Returns the array of pages contained in the selection.

string

Returns an NSString object representing the text contained in the selection (may contain linefeed characters).

attributedString

Returns an NSAttributedString object representing the text contained in the selection (may contain linefeed characters).

- boundsForPage:

Returns the bounds of the selection on the specified page.

- selectionsByLine

Returns an array of selections, one for each line of text covered by the receiver.

color

Sets the color used for the drawing of a selection in both active and inactive states.

Modifying a Selection

- addSelection:

Adds the specified selection to the receiving selection.

- addSelections:

Adds the specified array of selections to the receiving selection.

- extendSelectionAtEnd:

Extends the selection from its end toward the end of the document.

- extendSelectionAtStart:

Extends the selection from its start toward the beginning of the document.

Managing Selection Drawing

- drawForPage:active:

Calls drawForPage:withBox:active: with a default value for box parameter.

- drawForPage:withBox:active:

Draws the selection relative to the origin of the specified box in page space.

color

Sets the color used for the drawing of a selection in both active and inactive states.

Relationships

Inherits From

Conforms To

See Also

Content Model

PDFDocument

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

PDFPage

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

PDFOutline

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