Platforms to show: All Mac Windows Linux Cross-Platform

Back to PDFViewMBS class.

PDFViewMBS.annotationsChangedOnPage(page as PDFPageMBS)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method PDFKit MBS PDFKit Plugin 9.6 ✅ Yes ❌ No ❌ No ✅ Yes Desktop & iOS
Tells the PDF view that an annotation on the specified page has changed.

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.
Available in Mac OS X v10.5 and later.

PDFViewMBS.areaOfInterestForMouse(e as NSEventMBS) as Integer

Type Topic Plugin Version macOS Windows Linux iOS Targets
method PDFKit MBS PDFKit Plugin 9.6 ✅ Yes ❌ No ❌ No ❌ No Desktop only
Returns the type of area the mouse cursor is over.

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.

PDFViewMBS.areaOfInterestForPoint(p as NSPointMBS) as integer

Type Topic Plugin Version macOS Windows Linux iOS Targets
method PDFKit MBS PDFKit Plugin 21.1 ✅ Yes ❌ No ❌ No ❌ No Desktop only
Returns type of area (see defines above) mouse is over.

PDFViewMBS.clearSelection

Type Topic Plugin Version macOS Windows Linux iOS Targets
method PDFKit MBS PDFKit Plugin 9.6 ✅ Yes ❌ No ❌ No ✅ Yes Desktop & iOS
Clears the selection.

The view redraws as necessary but does not scroll. This call is equivalent to setting CurrentSelection=nil.

PDFViewMBS.Constructor

Type Topic Plugin Version macOS Windows Linux iOS Targets
method PDFKit MBS PDFKit Plugin 10.3 ✅ Yes ❌ No ❌ No ✅ Yes Desktop & iOS
Creates a new PDF view with size 100/100 and position 0/0
Example
dim t as new PDFViewMBS

On success the handle property is not zero.

See also:

PDFViewMBS.Constructor(Handle as Integer)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method PDFKit MBS PDFKit Plugin 10.3 ✅ Yes ❌ No ❌ No ✅ Yes Desktop & iOS
Creates an object based on the given PDFView handle.
Example
dim t as new PDFViewMBS(0, 0, 100, 100)
dim v as new PDFViewMBS(t.handle)

MsgBox str(v.Bounds.Width)+" x "+str(v.Bounds.Height)

The handle is casted to a NSButton and the plugin retains this handle.

See also:

PDFViewMBS.Constructor(left as Double, top as Double, width as Double, height as Double)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method PDFKit MBS PDFKit Plugin 9.6 ✅ Yes ❌ No ❌ No ✅ Yes Desktop & iOS
Creates a new PDF view with the given size and position.
Example
dim x as new PDFViewMBS(0, 0, 100, 100)

On success the handle property is not zero.

See also:

PDFViewMBS.convertPointFromPage(point as NSPointMBS, page as PDFPageMBS) as NSPointMBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
method PDFKit MBS PDFKit Plugin 10.3 ✅ Yes ❌ No ❌ No ✅ Yes Desktop & iOS
Converts a point from page space to view space.

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.

PDFViewMBS.convertPointToPage(point as NSPointMBS, page as PDFPageMBS) as NSPointMBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
method PDFKit MBS PDFKit Plugin 10.3 ✅ Yes ❌ No ❌ No ✅ Yes Desktop & iOS
Converts a point from view space to page space.
Example
// convert point from mouse event to page coordinates
Function MouseDown(x as Integer, y as Integer, Modifiers as Integer) Handles MouseDown as Boolean
Dim a As NSApplicationMBS = NSApplicationMBS.sharedApplication
Dim n As NSEventMBS = a.currentEvent
Dim v As PDFViewMBS = Me.View
Dim w As NSWindowMBS = Self.NSWindowMBS
Dim p As NSPointMBS = n.locationInWindow

System.DebugLog "p: "+str(p.x)+"/"+str(p.y)

Dim doc As PDFDocumentMBS = v.document
Dim page As PDFPageMBS = doc.pageAtIndex(0)
Dim r As NSPointMBS = v.convertPointFromView(p, Nil)

System.DebugLog "r: "+Str(r.x)+"/"+Str(r.y)

Dim d As NSPointMBS = v.convertPointToPage(r, page)

System.DebugLog "d: "+Str(d.x)+"/"+Str(d.y)
End Function

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.

PDFViewMBS.convertRectFromPage(rect as NSRectMBS, page as PDFPageMBS) as NSRectMBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
method PDFKit MBS PDFKit Plugin 10.3 ✅ Yes ❌ No ❌ No ✅ Yes Desktop & iOS
Converts a rectangle from page space to view space.

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.

Some examples using this method:

PDFViewMBS.convertRectToPage(rect as NSRectMBS, page as PDFPageMBS) as NSRectMBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
method PDFKit MBS PDFKit Plugin 10.3 ✅ Yes ❌ No ❌ No ✅ Yes Desktop & iOS
Converts a rectangle from view space to page space.

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.

PDFViewMBS.copy

Type Topic Plugin Version macOS Windows Linux iOS Targets
method PDFKit MBS PDFKit Plugin 9.6 ✅ Yes ❌ No ❌ No ✅ Yes Desktop & iOS
Copies the text in the selection, if any, to the Pasteboard.

PDFViewMBS.drawPage(page as PDFPageMBS)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method PDFKit MBS PDFKit Plugin 9.6 ✅ Yes ❌ No ❌ No ❌ No Desktop only
For use by subclasses of PDFView for custom rendering of pages.

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,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.

Changed in v22.5 to work on macOS Ventura.
But if the drawPage is called by macOS on the wrong thread, we ignore that to prevent StackOverflowException from Xojo runtime.

PDFViewMBS.drawPagePost(page as PDFPageMBS)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method PDFKit MBS PDFKit Plugin 9.6 ✅ Yes ❌ No ❌ No ❌ No Desktop only
For use by subclasses of PDFView for post-page rendering.

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).
Available in Mac OS X v10.5 and later.

PDFViewMBS.goBack

Type Topic Plugin Version macOS Windows Linux iOS Targets
method PDFKit MBS PDFKit Plugin 9.6 ✅ Yes ❌ No ❌ No ✅ Yes Desktop & iOS
Navigates back one step in the page history.

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

PDFViewMBS.goForward

Type Topic Plugin Version macOS Windows Linux iOS Targets
method PDFKit MBS PDFKit Plugin 9.6 ✅ Yes ❌ No ❌ No ✅ Yes Desktop & iOS
Navigates forward one step in the page history.

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

PDFViewMBS.goToDestination(page as PDFDestinationMBS)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method PDFKit MBS PDFKit Plugin 9.6 ✅ Yes ❌ No ❌ No ✅ Yes Desktop & iOS
Navigates to the specified destination.

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.

PDFViewMBS.goToFirstPage

Type Topic Plugin Version macOS Windows Linux iOS Targets
method PDFKit MBS PDFKit Plugin 9.6 ✅ Yes ❌ No ❌ No ✅ Yes Desktop & iOS
Navigates to the first page of the document.

PDF Kit records the move in its page history.

PDFViewMBS.goToLastPage

Type Topic Plugin Version macOS Windows Linux iOS Targets
method PDFKit MBS PDFKit Plugin 9.6 ✅ Yes ❌ No ❌ No ✅ Yes Desktop & iOS
Navigates to the last page of the document.

PDF Kit records the move in its page history.

PDFViewMBS.goToNextPage

Type Topic Plugin Version macOS Windows Linux iOS Targets
method PDFKit MBS PDFKit Plugin 9.6 ✅ Yes ❌ No ❌ No ✅ Yes Desktop & iOS
Navigates to the next page of the document.

PDF Kit records the move in its page history.

PDFViewMBS.goToPage(page as PDFPageMBS)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method PDFKit MBS PDFKit Plugin 9.6 ✅ Yes ❌ No ❌ No ✅ Yes Desktop & iOS
Scrolls to the specified page.

PDF Kit records the move in its page history.

PDFViewMBS.goToPreviousPage

Type Topic Plugin Version macOS Windows Linux iOS Targets
method PDFKit MBS PDFKit Plugin 9.6 ✅ Yes ❌ No ❌ No ✅ Yes Desktop & iOS
Navigates to the previous page of the document.

PDF Kit records the move in its page history.

PDFViewMBS.goToRect(rect as NSRectMBS, page as PDFPageMBS)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method PDFKit MBS PDFKit Plugin 9.6 ✅ Yes ❌ No ❌ No ✅ Yes Desktop & iOS
Navigates to the specified rectangle on the specified page.

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.
Available in Mac OS X v10.5 and later.

PDFViewMBS.goToSelection(page as PDFSelectionMBS)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method PDFKit MBS PDFKit Plugin 9.6 ✅ Yes ❌ No ❌ No ✅ Yes Desktop & iOS
Scrolls to the first character of the specified selection.

PDF Kit records the move in its page history.

PDFViewMBS.highlightedSelections as PDFSelectionMBS()

Type Topic Plugin Version macOS Windows Linux iOS Targets
method PDFKit MBS PDFKit Plugin 21.1 ✅ Yes ❌ No ❌ No ✅ Yes Desktop & iOS
Queries highlighted selections.

Unlike the user selection (above), these selections do not go away when the user clicks in the PDFView, etc. You must explicitly remove them by passing nil to setHighlightedSelections. These methods allow you to highlight text perhaps to indicate matches from a text search. To avoid confusion you should probably make sure the PDFSelectionMBS passed in are a different color from the user's default text selection color. Commonly used for highlighting search results.

PDFViewMBS.layoutDocumentView

Type Topic Plugin Version macOS Windows Linux iOS Targets
method PDFKit MBS PDFKit Plugin 9.6 ✅ Yes ❌ No ❌ No ✅ Yes Desktop & iOS
Performs layout of the inner views.

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).

PDFViewMBS.pageForPoint(point as NSPointMBS, nearest as boolean) as PDFPageMBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
method PDFKit MBS PDFKit Plugin 10.3 ✅ Yes ❌ No ❌ No ✅ Yes Desktop & iOS
Returns the page containing a point specified in view coordinates.

Returns nil if there's no page at the specified point and nearest is set to false.

PDFViewMBS.performAction(action as PDFActionMBS)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method PDFKit MBS PDFKit Plugin 9.6 ✅ Yes ❌ No ❌ No ✅ Yes Desktop & iOS
Performs the specified action.

Available in Mac OS X v10.5 and later.

PDFViewMBS.printWithInfo(printInfo as NSRectMBS, autoRotate as Boolean)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method PDFKit MBS PDFKit Plugin 21.1 ✅ Yes ❌ No ❌ No ❌ No Desktop only
Print the PDF document.

If autoRotate is true, will ignore the orientation attribute in printInfo and rather choose the orientation on a page by page basis that best fits the page to the paper size.

See also:

PDFViewMBS.printWithInfo(printInfo as NSRectMBS, autoRotate as Boolean, pageScaling as Integer)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method PDFKit MBS PDFKit Plugin 21.1 ✅ Yes ❌ No ❌ No ❌ No Desktop only
Like the above method but allows an additional parameter to describe page scaling (see PDFDocument.h for types).

If pageScaling is equal to kPDFPrintPageScaleToFit each page is scaled up or down in order to best fit the paper size. Specifying kPDFPrintPageScaleDownToFit for pageScaling will only scale large pages down to fit the paper, smaller pages will not be scaled up. Passing pageScaling equal to kPDFPrintPageScaleNone is the equivalent of calling printWithInfo above.

See also:

PDFViewMBS.rowSizeForPage(page as PDFPageMBS) as NSSizeMBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
method PDFKit MBS PDFKit Plugin 10.3 ✅ Yes ❌ No ❌ No ✅ Yes Desktop & iOS
Returns the size needed to display a row of the current document page.

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

PDFViewMBS.scrollSelectionToVisible

Type Topic Plugin Version macOS Windows Linux iOS Targets
method PDFKit MBS PDFKit Plugin 9.6 ✅ Yes ❌ No ❌ No ✅ Yes Desktop & iOS
Scrolls the view until the selection is visible.

PDFViewMBS.selectAll

Type Topic Plugin Version macOS Windows Linux iOS Targets
method PDFKit MBS PDFKit Plugin 9.6 ✅ Yes ❌ No ❌ No ✅ Yes Desktop & iOS
Selects all text in the document.

PDFViewMBS.setCurrentSelection(selection as PDFSelectionMBS, animate as boolean)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method PDFKit MBS PDFKit Plugin 9.6 ✅ Yes ❌ No ❌ No ✅ Yes Desktop & iOS
Sets the selection, in an animated way, if desired.

This method behaves as setCurrentSelection, but with the addition of animation, if animate is true. The animation serves to draw the user's attention to the new selection, which can be useful when implementing search.
Available in Mac OS X v10.5 and later.

PDFViewMBS.setCursorForAreaOfInterest(area as Integer)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method PDFKit MBS PDFKit Plugin 9.6 ✅ Yes ❌ No ❌ No ❌ No Desktop only
Sets the type of mouse cursor according to the type of area the mouse cursor is over.

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

PDFViewMBS.setHighlightedSelections(selections() as PDFSelectionMBS)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method PDFKit MBS PDFKit Plugin 21.1 ✅ Yes ❌ No ❌ No ✅ Yes Desktop & iOS
Sets highlighted selections.

Unlike the user selection (above), these selections do not go away when the user clicks in the PDFView, etc. You must explicitly remove them by passing nil to setHighlightedSelections. These methods allow you to highlight text perhaps to indicate matches from a text search. To avoid confusion you should probably make sure the PDFSelectionMBS passed in are a different color from the user's default text selection color. Commonly used for highlighting search results.

PDFViewMBS.visiblePages as PDFPageMBS()

Type Topic Plugin Version macOS Windows Linux iOS Targets
method PDFKit MBS PDFKit Plugin 10.3 ✅ Yes ❌ No ❌ No ✅ Yes Desktop & iOS
Returns an array of PDFPageMBS objects that represent the currently visible pages.

Available in Mac OS X v10.5 and later.

PDFViewMBS.zoomIn

Type Topic Plugin Version macOS Windows Linux iOS Targets
method PDFKit MBS PDFKit Plugin 9.6 ✅ Yes ❌ No ❌ No ✅ Yes Desktop & iOS
Zooms in by increasing the scaling factor.

Each invocation of zoomIn muliplies the scaling factor by the square root of 2.
Available in Mac OS X v10.4 and later.

PDFViewMBS.zoomOut

Type Topic Plugin Version macOS Windows Linux iOS Targets
method PDFKit MBS PDFKit Plugin 9.6 ✅ Yes ❌ No ❌ No ✅ Yes Desktop & iOS
Zooms out by decreasing the scaling factor.

Each invocation of zoomOut divides the scaling factor by the square root of 2.
Available in Mac OS X v10.4 and later.

The items on this page are in the following plugins: MBS PDFKit Plugin.


The biggest plugin in space...