Platforms to show: All Mac Windows Linux Cross-Platform
Back to PDFSelectionMBS class.
PDFSelectionMBS.addSelection(selection as PDFSelectionMBS)
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | PDFKit | MBS PDFKit Plugin | 8.0 | ✅ Yes | ❌ No | ❌ No | ✅ Yes | All |
Selections do not have to be contiguous. If the selection added overlaps with this selection, overlaps are removed.
PDFSelectionMBS.addSelections(selection() as PDFSelectionMBS)
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | PDFKit | MBS PDFKit Plugin | 9.6 | ✅ Yes | ❌ No | ❌ No | ✅ Yes | All |
This method provides better performance than multiple calls to addSelection if you need to add several selections to an existing selection. This is because the normalization of the selection (the removal of any overlaps between selections) occurs only once, after all selections have been added.
Available in Mac OS X v10.5 and later.
PDFSelectionMBS.boundsForPage(page as PDFPageMBS) as NSRectMBS
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | PDFKit | MBS PDFKit Plugin | 9.6 | ✅ Yes | ❌ No | ❌ No | ✅ Yes | All |
The selection rectangle is given in page space.
Page space is a 72 dpi coordinate system with the origin at the lower-left corner of the current page.
Some examples using this method:
PDFSelectionMBS.Constructor(doc as PDFDocumentMBS)
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | PDFKit | MBS PDFKit Plugin | 9.6 | ✅ Yes | ❌ No | ❌ No | ✅ Yes | All |
Typically, you don't need to create a PDFSelection object, but you can use an empty PDFSelection object as a container into which you can place selections, using addSelection: and addSelections.
Available in Mac OS X v10.5 and later.
See also:
PDFSelectionMBS.Constructor(Handle as Integer)
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | PDFKit | MBS PDFKit Plugin | 20.2 | ✅ Yes | ❌ No | ❌ No | ✅ Yes | All |
Please pass in a non zero handle which points to a PDFSelection object.
For use with declares.
See also:
PDFSelectionMBS.copy as PDFSelectionMBS
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | PDFKit | MBS PDFKit Plugin | 13.1 | ✅ Yes | ❌ No | ❌ No | ✅ Yes | All |
PDFSelectionMBS.drawForPage(page as PDFPageMBS, active as boolean)
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | PDFKit | MBS PDFKit Plugin | 9.6 | ✅ Yes | ❌ No | ❌ No | ✅ Yes | All |
The default value is kPDFDisplayBoxCropBox. If active is true, drawing uses selectedTextBackgroundColor. If false, it uses secondarySelectedControlColor.
See also:
PDFSelectionMBS.drawForPage(page as PDFPageMBS, box as Integer, active as boolean)
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | PDFKit | MBS PDFKit Plugin | 9.6 | ✅ Yes | ❌ No | ❌ No | ✅ Yes | All |
The selection is drawn using the current highlight color. If active is true, drawing uses selectedTextBackgroundColor. If false, it uses secondarySelectedControlColor. Refer to the PDFPage class for the list of available box types.
Page space is a 72 dpi coordinate system with the origin at the lower-left corner of the current page.
See also:
PDFSelectionMBS.extendSelectionAtEnd(chars as Integer)
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | PDFKit | MBS PDFKit Plugin | 8.0 | ✅ Yes | ❌ No | ❌ No | ✅ Yes | All |
Selections can be extended right off onto neighboring pages even to include the entire PDF document.
Some examples using this method:
PDFSelectionMBS.extendSelectionAtStart(chars as Integer)
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | PDFKit | MBS PDFKit Plugin | 8.0 | ✅ Yes | ❌ No | ❌ No | ✅ Yes | All |
Selections can be extended right off onto neighboring pages even to include the entire PDF document.
Some examples using this method:
PDFSelectionMBS.extendSelectionForLineBoundaries
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | PDFKit | MBS PDFKit Plugin | 21.1 | ✅ Yes | ❌ No | ❌ No | ✅ Yes | All |
If the current selection is on a single line, then this will extend it to the entire line width. If the selection is across multiple lines, then the first and last lines are expected to wholly contain their respective rows of text.
Available in macOS 10.13 or newer or iOS 11.0 or newer.
PDFSelectionMBS.numberOfTextRangesOnPage(page as PDFPageMBS) as UInt32
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | PDFKit | MBS PDFKit Plugin | 11.2 | ✅ Yes | ❌ No | ❌ No | ✅ Yes | All |
Returns zero if page is not in selection.
A typical, simple selection will contain a single range of text.
Available in Mac OS X 10.7 and later.
PDFSelectionMBS.pages as PDFPageMBS()
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | PDFKit | MBS PDFKit Plugin | 8.0 | ✅ Yes | ❌ No | ❌ No | ✅ Yes | All |
These are sorted by page index.
Returns nil on any error.
PDFSelectionMBS.rangeAtIndex(page as PDFPageMBS, index as Integer) as NSRangeMBS
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | PDFKit | MBS PDFKit Plugin | 11.2 | ✅ Yes | ❌ No | ❌ No | ✅ Yes | All |
A simple selection. A typical, simple selection will contain a single range of text.
Available in Mac OS X 10.7 and later.
PDFSelectionMBS.selectionsByLine as PDFSelectionMBS()
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | PDFKit | MBS PDFKit Plugin | 9.6 | ✅ Yes | ❌ No | ❌ No | ✅ Yes | All |
If you call this method on a PDFSelection object that represents a paragraph, for example, selectionsByLine returns an array that contains one PDFSelection object for each line of text in the paragraph.
Available in Mac OS X v10.5 and later.
The items on this page are in the following plugins: MBS PDFKit Plugin.