PDFView 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
PDFView.h
Related sample code

Overview

A PDFView object encapsulates the functionality of PDF Kit into a single widget that you can add to your application using Interface Builder.

PDFView may be the only class you need to deal with for adding PDF functionality to your application. It lets you display PDF data and allows users to select content, navigate through a document, set zoom level, and copy textual content to the Pasteboard. PDFView also keeps track of page history.

You can subclass PDFView to create a custom PDF viewer.

You can also create a custom PDF viewer by using the PDF Kit utility classes directly and not using PDFView at all.

Tasks

Associating a Document with a View

Navigating Within a Document

Working with Display Modes and Characteristics

Setting the Delegate

Scaling the View

Working with Mouse Position and Events

Handling Selections

Setting the Password

Rendering the View and Printing

Conversion Methods for Subclasses

Miscellaneous Methods

Managing Scale Factor

Handling URL Links

Responding to Annotation Actions

Changing the Print Job Title

Instance Methods

allowsDragging

Determines whether the view can accept new PDF documents dragged into it by the user.

- (BOOL)allowsDragging
Availability
  • Available in OS X v10.4 and later.
Declared In
PDFView.h

annotationsChangedOnPage:

Tells the PDF view that an annotation on the specified page has changed.

- (void)annotationsChangedOnPage:(PDFPage *)page
Discussion

When the PDFView object receives this message, it rescans for tool tips and pop-ups and informs the PDFThumbailView objects so the thumbnail images can be redrawn.

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

areaOfInterestForMouse:

Returns the type of area the mouse cursor is over.

- (PDFAreaOfInterest)areaOfInterestForMouse:(NSEvent *)theEvent
Discussion

The PDFAreaOfInterest enumeration defines the various area types. This method is for custom subclasses of the PDFView class. Use it if you override the NSResponder class’s mouseMoved: method or related methods.

Refer to “Constants” for the various values of the area-of-interest constants. Each of these constants contributes to the value of the PDFAreaOfInterest bit field.

Availability
  • Available in OS X v10.4 and later.
Declared In
PDFView.h

autoScales

Returns a Boolean value indicating whether autoscaling is set.

- (BOOL)autoScales
Availability
  • Available in OS X v10.4 and later.
Declared In
PDFView.h

backgroundColor

Returns the view’s background color.

- (NSColor *)backgroundColor
Discussion

A view’s background is the area displayed to either side of a PDF document’s pages. The background also appears between pages when page breaks are enabled. The default color is a 50% gray.

Availability
  • Available in OS X v10.4 and later.
Declared In
PDFView.h

canGoBack

Returns a Boolean value indicating whether the user can navigate to the previous page in the page history.

- (BOOL)canGoBack
Discussion

The page history gets built as your application calls navigation methods such as goToDestination: and goToLastPage:.

Availability
  • Available in OS X v10.4 and later.
See Also
Declared In
PDFView.h

canGoForward

Returns a Boolean value indicating whether the user can navigate to the next page in the page history.

- (BOOL)canGoForward
Discussion

The page history gets built as your application calls navigation methods such as goToDestination: and goToLastPage:.

Availability
  • Available in OS X v10.4 and later.
Declared In
PDFView.h

canGoToFirstPage

Returns a Boolean value indicating whether the user can navigate to the first page of the document.

- (BOOL)canGoToFirstPage
Discussion

The return value will be YES unless the view is already displaying the first page.

Availability
  • Available in OS X v10.4 and later.
Declared In
PDFView.h

canGoToLastPage

Returns a Boolean value indicating whether the user can navigate to the last page of the document.

- (BOOL)canGoToLastPage
Discussion

The return value will be YES unless the view is already displaying the last page.

Availability
  • Available in OS X v10.4 and later.
Declared In
PDFView.h

canGoToNextPage

Returns a Boolean value indicating whether the user can navigate to the next page of the document.

- (BOOL)canGoToNextPage
Discussion

The return value will be YES unless the view is displaying the last page.

Availability
  • Available in OS X v10.4 and later.
Declared In
PDFView.h

canGoToPreviousPage

Returns a Boolean value indicating whether the user can navigate to the previous page of the document.

- (BOOL)canGoToPreviousPage
Discussion

The return value will be YES unless the view is displaying the first page.

Availability
  • Available in OS X v10.4 and later.
Declared In
PDFView.h

canZoomIn

Returns a Boolean value indicating whether the user can magnify the view—that is, zoom in.

- (BOOL)canZoomIn
Availability
  • Available in OS X v10.4 and later.
Declared In
PDFView.h

canZoomOut

Returns a Boolean value indicating whether the user can view an expanded area—that is, zoom out.

- (BOOL)canZoomOut
Availability
  • Available in OS X v10.4 and later.
Declared In
PDFView.h

clearSelection

Clears the selection.

- (void)clearSelection
Discussion

The view redraws as necessary but does not scroll. This call is equivalent to calling [PDFView setCurrentSelection:NULL].

Availability
  • Available in OS X v10.4 and later.
Declared In
PDFView.h

convertPoint:fromPage:

Converts a point from page space to view space.

- (NSPoint)convertPoint:(NSPoint)point fromPage:(PDFPage *)page
Discussion

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

Availability
  • Available in OS X v10.4 and later.
Declared In
PDFView.h

convertPoint:toPage:

Converts a point from view space to page space.

- (NSPoint)convertPoint:(NSPoint)point toPage:(PDFPage *)page
Discussion

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

Availability
  • Available in OS X v10.4 and later.
Declared In
PDFView.h

convertRect:fromPage:

Converts a rectangle from page space to view space.

- (NSRect)convertRect:(NSRect)rect fromPage:(PDFPage *)page
Discussion

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

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

convertRect:toPage:

Converts a rectangle from view space to page space.

- (NSRect)convertRect:(NSRect)rect toPage:(PDFPage *)page
Discussion

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

Availability
  • Available in OS X v10.4 and later.
Declared In
PDFView.h

copy:

Copies the text in the selection, if any, to the Pasteboard.

- (void)copy:(id)sender
Availability
  • Available in OS X v10.4 and later.
Declared In
PDFView.h

currentDestination

Returns a PDFDestination object representing the current page and the current point in the view specified in page space.

- (PDFDestination *)currentDestination
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
Declared In
PDFView.h

currentPage

Returns the current page.

- (PDFPage *)currentPage
Discussion

When there are two pages in the view in a two-up mode, “current page” is the left page. For continuous modes, returns the page crossing a horizontal line halfway between the view’s top and bottom bounds.

Availability
  • Available in OS X v10.4 and later.
Declared In
PDFView.h

currentSelection

Returns the current selection.

- (PDFSelection *)currentSelection
Discussion

Returns NULL if no selection exists.

Note that this method returns the actual instance of the current PDFSelection object. Therefore, if you want to modify it, you should make a copy of the returned selection and modify that, instead.

Availability
  • Available in OS X v10.4 and later.
Declared In
PDFView.h

delegate

Returns the view’s delegate.

- (id)delegate
Availability
  • Available in OS X v10.4 and later.
Declared In
PDFView.h

displayBox

Returns the current style of display box.

- (PDFDisplayBox)displayBox
Discussion

The available values for display boxes are defined in the Constants section in the PDFPage class.

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

displayMode

Returns the current display mode.

- (PDFDisplayMode)displayMode
Discussion

See “Constants” for possible values.

Availability
  • Available in OS X v10.4 and later.
Declared In
PDFView.h

displaysAsBook

Returns a Boolean value indicating whether the view will display the first page as a book cover (meaningful only when the document is in two-up or two-up continuous display mode).

- (BOOL)displaysAsBook
Availability
  • Available in OS X v10.4 and later.
Declared In
PDFView.h

displaysPageBreaks

Returns a Boolean value indicating whether the view is displaying page breaks.

- (BOOL)displaysPageBreaks
Availability
  • Available in OS X v10.4 and later.
Declared In
PDFView.h

document

Returns the document associated with a PDFView object.

- (PDFDocument *)document
Availability
  • Available in OS X v10.4 and later.
Related Sample Code
Declared In
PDFView.h

documentView

Returns the innermost view used by PDFView or by your PDFView subclass.

- (NSView *)documentView
Discussion

The innermost view is the one displaying the visible document pages. This method is useful when converting coordinates from one view to another.

Availability
  • Available in OS X v10.4 and later.
Declared In
PDFView.h

drawPage:

For use by subclasses of PDFView for custom rendering of pages.

- (void)drawPage:(PDFPage *)page
Discussion

Do not invoke this method, except by invoking it on super from a subclass.

The PDFView class calls drawPage: as necessary for each visible page that requires rendering. In the PDFView class, this method erases page to white, calls [page drawInRect: pageRect withBox: [self displayBox]] , and then draws the selection, if any.

You can override this method to draw on top of a PDF page or to control how pages are drawn. In these cases, invoke this method on super and then perform custom drawing on top of the PDF page.

Availability
  • Available in OS X v10.4 and later.
Declared In
PDFView.h

drawPagePost:

For use by subclasses of PDFView for post-page rendering.

- (void)drawPagePost:(PDFPage *)page
Discussion

The default implementation of this method draws the text highlighting (if any) for the page. This method does not apply scaling or rotating to the current context to map to page space; instead, the context is in view-space coordinates (in which the origin is at the lower-left corner of the current PDF view).

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

goBack:

Navigates back one step in the page history.

- (IBAction)goBack:(id)sender
Discussion

The page history gets built as your application calls navigation methods such as goToDestination: and goToLastPage:.

Availability
  • Available in OS X v10.4 and later.
Declared In
PDFView.h

goForward:

Navigates forward one step in the page history.

- (IBAction)goForward:(id)sender
Discussion

The page history gets built as your application calls navigation methods such as goToDestination: and goToLastPage:.

Availability
  • Available in OS X v10.4 and later.
Declared In
PDFView.h

goToDestination:

Navigates to the specified destination.

- (void)goToDestination:(PDFDestination *)destination
Discussion

Destinations include a page and a point on the page specified in page space.

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
Declared In
PDFView.h

goToFirstPage:

Navigates to the first page of the document.

- (IBAction)goToFirstPage:(id)sender
Discussion

PDF Kit records the move in its page history.

Availability
  • Available in OS X v10.4 and later.
Declared In
PDFView.h

goToLastPage:

Navigates to the last page of the document.

- (IBAction)goToLastPage:(id)sender
Discussion

PDF Kit records the move in its page history.

Availability
  • Available in OS X v10.4 and later.
Declared In
PDFView.h

goToNextPage:

Navigates to the next page of the document.

- (IBAction)goToNextPage:(id)sender
Discussion

PDF Kit records the move in its page history.

Availability
  • Available in OS X v10.4 and later.
Declared In
PDFView.h

goToPage:

Scrolls to the specified page.

- (void)goToPage:(PDFPage *)page
Discussion

PDF Kit records the move in its page history.

Availability
  • Available in OS X v10.4 and later.
Declared In
PDFView.h

goToPreviousPage:

Navigates to the previous page of the document.

- (IBAction)goToPreviousPage:(id)sender
Discussion

PDF Kit records the move in its page history.

Availability
  • Available in OS X v10.4 and later.
Declared In
PDFView.h

goToRect:onPage:

Navigates to the specified rectangle on the specified page.

- (void)goToRect:(NSRect)rect onPage:(PDFPage *)page
Discussion

If the specified rectangle is already visible, this method does nothing. This allows you to scroll the PDFView object to a specific PDFAnnotation or PDFSelection object, because both of these objects have bounds methods that return an annotation or selection position in page space.

Note that rect is specified in page-space coordinates. 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.5 and later.
Declared In
PDFView.h

goToSelection:

Scrolls to the first character of the specified selection.

- (void)goToSelection:(PDFSelection *)selection
Discussion

PDF Kit records the move in its page history.

Availability
  • Available in OS X v10.4 and later.
Declared In
PDFView.h

greekingThreshold

Returns the current greeking threshold for the view.

- (float)greekingThreshold
Availability
  • Available in OS X v10.4 and later.
Declared In
PDFView.h

highlightedSelections

Returns the array of selections that are highlighted using setHighlightedSelections.

- (NSArray *)highlightedSelections
Availability
  • Available in OS X v10.5 and later.
Declared In
PDFView.h

layoutDocumentView

Performs layout of the inner views.

- (void)layoutDocumentView
Discussion

The PDFView actually contains several subviews, such as the document view (where the PDF is actually drawn) and a “matte view” (which may appear as a gray area around the PDF content, depending on the scaling). Changes to the PDF content may require changes to these inner views, so you must call this method explicitly if you use PDF Kit utility classes to add or remove a page, rotate a page, or perform other operations affecting visible layout.

This method is called automatically from PDFView methods that affect the visible layout (such as setDocument:, setDisplayBox: or zoomIn:).

Availability
  • Available in OS X v10.4 and later.
Declared In
PDFView.h

pageForPoint:nearest:

Returns the page containing a point specified in view coordinates.

- (PDFPage *)pageForPoint:(NSPoint)point nearest:(BOOL)nearest
Discussion

Returns NULL if there’s no page at the specified point and nearest is set to NO.

Availability
  • Available in OS X v10.4 and later.
Declared In
PDFView.h

performAction:

Performs the specified action.

- (void)performAction:(PDFAction *)action
Availability
  • Available in OS X v10.5 and later.
Declared In
PDFView.h

printWithInfo:autoRotate:

Prints the document with the specified printer information.

- (void)printWithInfo:(NSPrintInfo *)printInfo autoRotate:(BOOL)doRotate
Discussion

If autoRotate is set to YES, then ths method ignores the orientation attribute in the NSPrintInfo object and instead chooses the orientation that best fits the page to the paper size. This orientation occurs on a page-by-page basis.

Availability
  • Available in OS X v10.4 and later.
Declared In
PDFView.h

printWithInfo:autoRotate:pageScaling:

Prints the document with the specified printer and page-scaling information.

- (void)printWithInfo:(NSPrintInfo *)printInfo autoRotate:(BOOL)doRotate pageScaling:(PDFPrintScalingMode)scale
Discussion

If pageScaling is set to kPDFPrintPageScaleToFit, each page is scaled up or down to best fit the paper size. If pageScaling is set to kPDFPrintPageScaleDownToFit, only large pages are scaled down to fit; small pages are not scaled up to fit. Specifying kPDFPrintPageScaleNone for pageScaling is equivalent to calling printWithInfo:autoRotate:. See PDFDocument for more information on page-scaling types.

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

rowSizeForPage:

Returns the size needed to display a row of the current document page.

- (NSSize)rowSizeForPage:(PDFPage *)page
Discussion

The size is dependent on the current scale factor and display attributes.

Availability
  • Available in OS X v10.4 and later.
Declared In
PDFView.h

scaleFactor

Returns the current scale factor for the view.

- (float)scaleFactor
Availability
  • Available in OS X v10.4 and later.
Related Sample Code
Declared In
PDFView.h

scrollSelectionToVisible:

Scrolls the view until the selection is visible.

- (void)scrollSelectionToVisible:(id)sender
Availability
  • Available in OS X v10.4 and later.
Declared In
PDFView.h

selectAll:

Selects all text in the document.

- (IBAction)selectAll:(id)sender
Availability
  • Available in OS X v10.4 and later.
Declared In
PDFView.h

setAllowsDragging:

Specifies whether the view can accept drags.

- (void)setAllowsDragging:(BOOL)allow
Discussion

If set to YES, the user can drag a new PDF document into the view. The new document is then displayed in the view, and the old document is released.

Availability
  • Available in OS X v10.4 and later.
Declared In
PDFView.h

setAutoScales:

Toggles whether the scaling factor applied to a view automatically responds to resizing.

- (void)setAutoScales:(BOOL)newAuto
Discussion

When set to autoscaling, the document scales to fill the PDFView object as the user resizes it.

For the single-page and two-up continuous modes, autoscaling fits the page to the width of the view. For single-page and two-up noncontinuous modes, autoscaling provides best fit, in which the viewed pages are as large as possible while displaying in their entirety within the view.

Availability
  • Available in OS X v10.4 and later.
Declared In
PDFView.h

setBackgroundColor:

Sets the view’s background color.

- (void)setBackgroundColor:(NSColor *)newColor
Discussion

A view’s background is the area displayed to either side of a PDF document’s pages. The background also appears between pages when page breaks are enabled. The default color is a 50% gray.

Availability
  • Available in OS X v10.4 and later.
Declared In
PDFView.h

setCurrentSelection:

Sets the selection.

- (void)setCurrentSelection:(PDFSelection *)selection
Discussion

The view redraws as necessary but does not scroll. If you need to scroll to the current selection, use scrollSelectionToVisible:. If you pass nil for the selection, this call is equivalent to calling clearSelection.

Availability
  • Available in OS X v10.4 and later.
Declared In
PDFView.h

setCurrentSelection:animate:

Sets the selection, in an animated way, if desired.

- (void)setCurrentSelection:(PDFSelection *)selection animate:(BOOL)animate
Discussion

This method behaves as setCurrentSelection:, but with the addition of animation, if animate is YES. The animation serves to draw the user’s attention to the new selection, which can be useful when implementing search.

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

setCursorForAreaOfInterest:

Sets the type of mouse cursor according to the type of area the mouse cursor is over.

- (void)setCursorForAreaOfInterest:(PDFAreaOfInterest)area
Discussion

This method is especially useful for custom subclasses of the PDFView class.

Availability
  • Available in OS X v10.4 and later.
Declared In
PDFView.h

setDelegate:

Sets a delegate for the view.

- (void)setDelegate:(id)anObject
Availability
  • Available in OS X v10.4 and later.
See Also
Declared In
PDFView.h

setDisplayBox:

Specifies the box to display and to clip to.

- (void)setDisplayBox:(PDFDisplayBox)box
Discussion

The values for box are defined in the PDFDisplayBox enumeration. The default value for this method is kPDFDisplayBoxCropBox.

The available values for display boxes are defined in the Constants section in the PDFPage class.

Availability
  • Available in OS X v10.4 and later.
Declared In
PDFView.h

setDisplayMode:

Sets the display mode for the view.

- (void)setDisplayMode:(PDFDisplayMode)mode
Discussion

Available display modes are single page, single-page continuous, two-up, and two-up continuous, as defined in “Constants.”

Availability
  • Available in OS X v10.4 and later.
Declared In
PDFView.h

setDisplaysAsBook:

Specifies whether the view should treat the document’s first page as a book cover.

- (void)setDisplaysAsBook:(BOOL)asBook
Discussion

For two-up modes, a YES value for this method specifies that the first page should be displayed by itself.

Availability
  • Available in OS X v10.4 and later.
Declared In
PDFView.h

setDisplaysPageBreaks:

Toggles the display of page breaks.

- (void)setDisplaysPageBreaks:(BOOL)breaks
Availability
  • Available in OS X v10.4 and later.
Declared In
PDFView.h

setDocument:

Associates a document with a PDFView object.

- (void)setDocument:(PDFDocument *)document
Discussion

If a document was already associated with the view, it is released first and then document is associated with the view.

Availability
  • Available in OS X v10.4 and later.
See Also
Declared In
PDFView.h

setGreekingThreshold:

Sets the greeking threshold to use for displaying text.

- (void)setGreekingThreshold:(float)threshold
Discussion

The default threshold is 3.0.

Availability
  • Available in OS X v10.4 and later.
Declared In
PDFView.h

setHighlightedSelections:

Highlights the specified array of selections.

- (void)setHighlightedSelections:(NSArray *)selections
Discussion

Unlike the selections users set (using, for example, setCurrentSelection:), the selections you specify in this method do not go away (that is, appear deselected) when users click elsewhere in the view or document. Instead, to deselect the selections, you must call [setHighlightedSelections:NULL] to remove them.

You might use this method to highlight the set of matches from a text search. To prevent the user from confusing their own selections with selections you set using this method, it is recommended that you use a highlight color that is different from the user’s default text selection color.

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

setScaleFactor:

Sets the scale factor for the view.

- (void)setScaleFactor:(float)scale
Discussion

The default value is 1.0, corresponding to actual size.

Availability
  • Available in OS X v10.4 and later.
Declared In
PDFView.h

setShouldAntiAlias:

Specifies whether to use anti-aliasing in the view.

- (void)setShouldAntiAlias:(BOOL)aliasing
Discussion

The default value is YES.

Availability
  • Available in OS X v10.4 and later.
Declared In
PDFView.h

shouldAntiAlias

Returns a Boolean value indicating whether the view is anti-aliased.

- (BOOL)shouldAntiAlias
Availability
  • Available in OS X v10.4 and later.
Declared In
PDFView.h

takeBackgroundColorFrom:

Sets the view’s background color to the specified color.

- (IBAction)takeBackgroundColorFrom:(id)sender
Discussion

A view’s background is the area displayed to either side of a PDF document’s pages. The background also appears between pages when page breaks are enabled. The default color is a 50% gray.

Availability
  • Available in OS X v10.4 and later.
Declared In
PDFView.h

takePasswordFrom:

A convenience method that calls – [[self document] setpassword:] with the password from the specified sender.

- (void)takePasswordFrom:(id)sender
Availability
  • Available in OS X v10.4 and later.
Declared In
PDFView.h

visiblePages

Returns an array of PDFPage objects that represent the currently visible pages.

- (NSArray *)visiblePages
Availability
  • Available in OS X v10.5 and later.
Declared In
PDFView.h

zoomIn:

Zooms in by increasing the scaling factor.

- (IBAction)zoomIn:(id)sender
Discussion

Each invocation of zoomIn muliplies the scaling factor by the square root of 2.

Availability
  • Available in OS X v10.4 and later.
Declared In
PDFView.h

zoomOut:

Zooms out by decreasing the scaling factor.

- (IBAction)zoomOut:(id)sender
Discussion

Each invocation of zoomOut divides the scaling factor by the square root of 2.

Availability
  • Available in OS X v10.4 and later.
Declared In
PDFView.h

Delegate Methods

PDFViewOpenPDF:forRemoteGoToAction:

Delegate method that opens a specified page.

- (void)PDFViewOpenPDF:(PDFView *)sender forRemoteGoToAction:(PDFActionRemoteGoTo *)action
Discussion

A delegate responding to this method is called to handle clicks in an annotation that contains a PDFActionRemoteGoTo action. Such an action contains a URL, a page index, and a point. The delegate should open the PDF document specified by the URL and go to the specified page and point. An easy way to do this is to create a PDFDocument object with the specified URL and then create a PDFDestination object with the specified page and point. Then, you can call goToDestination:.

The default implementation of this method beeps.

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

PDFViewPerformFind:

Delegate method that performs a find operation.

- (void)PDFViewPerformFind:(PDFView *)sender
Discussion

Some PDFAction objects request a PDF viewer application to perform a find operation. A delegate responding to this method is called when users click an annotation with such an action.

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

PDFViewPerformGoToPage:

Delegate method that performs a go-to operation.

- (void)PDFViewPerformGoToPage:(PDFView *)sender
Discussion

Some PDFAction objects request a PDF viewer application to display a panel that allows users to enter a page number to go to. A delegate responding to this method is called when users click an annotation with such an action.

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

PDFViewPerformPrint:

Delegate method that prints the current document.

- (void)PDFViewPerformPrint:(PDFView *)sender
Discussion

Some PDFAction objects request a PDF viewer application to print the current document. A delegate responding to this method is called when users click an annotation with such an action.

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

PDFViewPrintJobTitle:

Delegate method that overrides the job title used when the PDFView is printed.

- (NSString *)PDFViewPrintJobTitle:(PDFView *)sender
Discussion

By default, this method uses the string, if any, associated with the “Title” key in the view’s PDFDocument attribute dictionary. If there is no such string, this method uses the last path component if the document is URL-based.

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

PDFViewWillChangeScaleFactor:toScale:

Delegate method for overriding changes to scale factor.

- (float)PDFViewWillChangeScaleFactor:(PDFView *)sender toScale:(float)scale
Discussion

By default, the scale factor is restricted to a range between 0.1 and 10.0 inclusive.

Availability
  • Available in OS X v10.4 and later.
Declared In
PDFView.h

PDFViewWillClickOnLink:withURL:

Delegate method for handling clicks on URL links in a view.

- (void)PDFViewWillClickOnLink:(PDFView *)sender withURL:(NSURL *)url
Discussion

By default, this method calls [[NSWorkspace sharedWorkspace] openURL:url].

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

Constants

PDF views use the following display mode constants:

Constant

Description

kPDFDisplaySinglePage

The document displays one page at a time horizontally and vertically. Vertical and horizontal scrolling apply only to the current page.

Available in OS X v10.4 and later.

Declared in PDFView.h.

kPDFDisplaySinglePageContinuous

The document displays in continuous mode vertically, with single-page width horizontally. Vertical scrolling applies to the entire document.

Available in OS X v10.4 and later.

Declared in PDFView.h.

kPDFDisplayTwoUp

The document displays two pages side-by-side. Vertical and horizontal scrolling apply only to the pair of displayed pages

Available in OS X v10.4 and later.

Declared in PDFView.h.

kPDFDisplayTwoUpContinuous

The document displays in continuous mode vertically and displays two pages side-by-side horizontally. Vertical scrolling applies to the entire document.

Available in OS X v10.4 and later.

Declared in PDFView.h.

The following constants apply to mouse position over PDF view areas. These constants are components of a bit field and may be combined arbitrarily:

Constant

Description

kPDFNoArea

The mouse is over an undefined area.

Available in OS X v10.4 and later.

Declared in PDFView.h.

kPDFPageArea

The mouse is over a page.

Available in OS X v10.4 and later.

Declared in PDFView.h.

kPDFTextArea

The mouse is over text.

Available in OS X v10.4 and later.

Declared in PDFView.h.

kPDFAnnotationArea

The mouse is over an annotation.

Available in OS X v10.4 and later.

Declared in PDFView.h.

kPDFLinkArea

The mouse is over a link.

Available in OS X v10.4 and later.

Declared in PDFView.h.

kPDFControlArea

The mouse is over a control.

Available in OS X v10.4 and later.

Declared in PDFView.h.

kPDFTextFieldArea

The mouse is over a text field.

Available in OS X v10.4 and later.

Declared in PDFView.h.

kPDFIconArea

The mouse is over an icon.

Available in OS X v10.5 and later.

Declared in PDFView.h.

kPDFPopupArea

The mouse is over a popup menu.

Available in OS X v10.4 and later.

Declared in PDFView.h.

Notifications

A PDFView object posts the following notifications:

PDFViewChangedHistoryNotification

Posted when the page history changes.

The notification object is the PDFView object itself.

Availability
Declared In
PDFView.h

PDFViewDocumentChangedNotification

Posted when a new document is associated with the view.

The notification object is the PDFView object itself.

Availability
Declared In
PDFView.h

PDFViewPageChangedNotification

Posted when a new page becomes the current page.

The notification object is the PDFView object itself.

Availability
Declared In
PDFView.h

PDFViewScaleChangedNotification

Posted when the scale factor changes.

The notification object is the PDFView object itself.

Availability
Declared In
PDFView.h

PDFViewAnnotationHitNotification

Posted when the user clicks on an annotation.

The notification object is the PDFView object itself.

Use the @"PDFAnnotationHit" key to obtain userinfo of type PDFAnnotation *.

Availability
Declared In
PDFView.h

PDFViewCopyPermissionNotification

Posted when the user attempts to copy to the pasteboard without the appropriate permissions.

The notification object is the PDFView object itself.

Availability
Declared In
PDFView.h

PDFViewPrintPermissionNotification

Posted when the user attempts to print without the appropriate permissions.

The notification object is the PDFView object itself.

Availability
Declared In
PDFView.h

PDFViewAnnotationWillHitNotification

Posted before the user clicks an annotation.

The notification object is the PDFView object itself.

Availability
Declared In
PDFView.h

PDFViewSelectionChangedNotification

Posted when the current selection has changed.

The notification object is the PDFView object itself.

Availability
Declared In
PDFView.h

PDFViewDisplayModeChangedNotification

Posted when the display mode has changed.

The notification object is the PDFView object itself.

Availability
Declared In
PDFView.h

PDFViewDisplayBoxChangedNotification

Posted when the display box has changed.

The notification object is the PDFView object itself.

Availability
Declared In
PDFView.h