PDFDestination Class Reference

Inherits from
Conforms to
Framework
Library/Frameworks/Quartz.framework/Frameworks/PDFKit.framework
Availability
Available in OS X v10.4 and later.
Declared in
PDFDestination.h
Related sample code

Overview

A PDFDestination object describes a point on a PDF page.

In typical usage, you do not initialize PDFDestination objects but rather get them as either attributes of PDFAnnotationLink or PDFOutline objects, or in response to the PDFView method currentDestination.

Tasks

Initializing a Destination

Getting Pages and Points

Getting a Relative Location

Instance Methods

compare:

Returns a comparison result that indicates the location of the destination in the document, relative to the current position.

- (NSComparisonResult)compare:(PDFDestination *)destination
Parameters
destination

The destination in the document to be located.

Return Value

A comparison result, indicating the position of the passed-in destination relative to the current position.

Discussion

If destination is between the receiver’s position and the end of the document, compare returns NSOrderedAscending; if it is between the receiver’s position and the beginning of the document, compare returns NSOrderedDescending. Otherwise, if destination matches the receiver’s position, compare returns NSOrderedSame.

This method ignores the horizontal component of the destination point (the x value). If the destination’s vertical component (or y value) is kPDFDestinationUnspecifiedValue, compare treats the destination as if its y value is the top point on the destination page.

An exception is raised if destination does not have a page associated with it or if its page is associated with a document other than the receiver’s document.

Availability
  • Available in OS X v10.5 and later.
Declared In
PDFDestination.h

initWithPage:atPoint:

Initializes the destination.

- (id)initWithPage:(PDFPage *)page atPoint:(NSPoint)point
Parameters
page

The page of the destination.

point

The point of the destination, in page space.

Return Value

An initialized PDFDestination instance, or NULL if the object could not be initialized.

Discussion

Specify point in page space. Typically, there’s no need to initialize destinations. Instead, you get them from PDFAnnotationLink, PDFOutline, or PDFView objects.

Page space is a 72-dpi coordinate system with the origin at the lower-left corner of the current page.

Availability
  • Available in OS X v10.4 and later.
Related Sample Code
Declared In
PDFDestination.h

page

Returns the page that the destination refers to.

- (PDFPage *)page
Return Value

The page referred to by the destination.

Availability
  • Available in OS X v10.4 and later.
See Also
Related Sample Code
Declared In
PDFDestination.h

point

Returns the point, in page space, that the destination refers to.

- (NSPoint)point
Return Value

The point, in page space, referred to by the destination.

Discussion

Page space is a 72 dpi coordinate system with the origin at the lower-left corner of the current page.

Availability
  • Available in OS X v10.4 and later.
See Also
Related Sample Code
Declared In
PDFDestination.h

Constants

Destination Undefined

Value used for unspecified destination.

#define kPDFDestinationUnspecifiedValue         FLT_MAX
Constants
kPDFDestinationUnspecifiedValue

Unspecified value used when a destination’s actual x or y value is unimportant.

Available in OS X v10.5 and later.

Declared in PDFDestination.h.