Platforms to show: All Mac Windows Linux Cross-Platform
Back to PDFDocumentMBS class.
PDFDocumentMBS.appendPage(page as PDFPageMBS)
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | PDFKit | MBS PDFKit Plugin | 14.3 | ✅ Yes | ❌ No | ❌ No | ✅ Yes | All |
PDFDocumentMBS.beginFindString(text as string, options as Integer)
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | PDFKit | MBS PDFKit Plugin | 8.0 | ✅ Yes | ❌ No | ❌ No | ✅ Yes | All |
Search results are handled via a DidFindMatch event in the delegate. Supported options are: NSCaseInsensitiveSearch, NSLiteralSearch, and NSBackwardsSearch.
PDFDocumentMBS.beginFindStrings(texts() as string, options as integer)
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | PDFKit | MBS PDFKit Plugin | 21.1 | ✅ Yes | ❌ No | ❌ No | ✅ Yes | All |
PDFDocumentMBS.cancelFindString
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | PDFKit | MBS PDFKit Plugin | 8.0 | ✅ Yes | ❌ No | ❌ No | ✅ Yes | All |
Can be called from a user method being serviced by a find notification.
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | PDFKit | MBS PDFKit Plugin | 9.6 | ✅ Yes | ❌ No | ❌ No | ✅ Yes | All |
See also:
PDFDocumentMBS.Constructor(data as memoryblock)
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | PDFKit | MBS PDFKit Plugin | 8.0 | ✅ Yes | ❌ No | ❌ No | ✅ Yes | All |
See also:
PDFDocumentMBS.Constructor(data as String)
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | PDFKit | MBS PDFKit Plugin | 21.1 | ✅ Yes | ❌ No | ❌ No | ✅ Yes | All |
See also:
PDFDocumentMBS.Constructor(file as folderitem)
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | PDFKit | MBS PDFKit Plugin | 8.0 | ✅ Yes | ❌ No | ❌ No | ✅ Yes | All |
See also:
PDFDocumentMBS.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 PDFDocument object.
For use with declares.
See also:
PDFDocumentMBS.copy as PDFDocumentMBS
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | PDFKit | MBS PDFKit Plugin | 13.1 | ✅ Yes | ❌ No | ❌ No | ✅ Yes | All |
For Mac OS X 10.7 and newer this function uses the framework function.
For Mac OS X 10.6 and older this function uses our own copy function to duplicate the document.
PDFDocumentMBS.dataRepresentation(QuartzFilter as Variant = nil) as memoryblock
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | PDFKit | MBS PDFKit Plugin | 11.2 | ✅ Yes | ❌ No | ❌ No | ✅ Yes | All |
Optional for Mac OS X 10.6, you can pass a QuartzFilterMBS object to use that filter here.
Looks like newer macOS versions like 10.14 or later ignore the quartz filter.
PDFDocumentMBS.documentAttributes as Dictionary
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
property | PDFKit | MBS PDFKit Plugin | 11.2 | ✅ Yes | ❌ No | ❌ No | ✅ Yes | All |
Returns a dictionary with PDF metadata. Metadata is optional for PDF's and so some of the keys may be missing or the entire dictionary may be empty.
(Read and Write computed property)
PDFDocumentMBS.exchangePageAtIndexWithPageAtIndex(indexA as Integer, indexB as Integer)
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | PDFKit | MBS PDFKit Plugin | 8.0 | ✅ Yes | ❌ No | ❌ No | ✅ Yes | All |
Index is zero based.
PDFDocumentMBS.findString(text as string, options as Integer) as PDFSelectionMBS()
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | PDFKit | MBS PDFKit Plugin | 8.0 | ✅ Yes | ❌ No | ❌ No | ✅ Yes | All |
May return an empty array if nothing is found.
Returns nil on any error.
Supported options are:
NSCaseInsensitiveSearch, NSLiteralSearch, and NSBackwardsSearch.
PDFDocumentMBS.findStringFromSelection(text as string, selection as PDFSelectionMBS, options as Integer) as PDFSelectionMBS
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | PDFKit | MBS PDFKit Plugin | 8.0 | ✅ Yes | ❌ No | ❌ No | ✅ Yes | All |
Returns next instance as a PDFSelection or nil if the end of the document is reached. Supported options are: NSCaseInsensitiveSearch, NSLiteralSearch, and NSBackwardsSearch. Passing in nil for selection will start the search from the beginning of the document (or end if NSBackwardsSearch is specified).
PDFDocumentMBS.indexForPage(page as PDFPageMBS) as Integer
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | PDFKit | MBS PDFKit Plugin | 8.0 | ✅ Yes | ❌ No | ❌ No | ✅ Yes | All |
Indicees are zero-based.
PDFDocumentMBS.insertPage(page as PDFPageMBS, index as Integer)
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | PDFKit | MBS PDFKit Plugin | 8.0 | ✅ Yes | ❌ No | ❌ No | ✅ Yes | All |
Index is zero based.
Some examples using this method:
PDFDocumentMBS.Keywords as string()
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | PDFKit | MBS PDFKit Plugin | 8.0 | ✅ Yes | ❌ No | ❌ No | ✅ Yes | All |
PDFDocumentMBS.outlineItemForSelection(selection as PDFSelectionMBS) as PDFOutlineMBS
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | PDFKit | MBS PDFKit Plugin | 8.0 | ✅ Yes | ❌ No | ❌ No | ✅ Yes | All |
Since a selection may span multiple outline items, only the point representing the first character of the PDFSelection is considered. Typically, outline's indicate things like chapters for the PDF. Therefore, this method would help you identify the chapter the selection falls within.
For some PDFs this method returns nil.
PDFDocumentMBS.pageAtIndex(index as Integer) as PDFPageMBS
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | PDFKit | MBS PDFKit Plugin | 8.0 | ✅ Yes | ❌ No | ❌ No | ✅ Yes | All |
Will raise an exception if index is out of bounds. Indicees are zero-based.
Some examples using this method:
- /MacExtras/Continuity Camera
- /MacFrameworks/IKSlideShow
- /PDFKit/Add Annotations to PDF
- /PDFKit/Add Outlines with Actions to PDF
- /PDFKit/Add Outlines with Destinations to PDF
- /PDFKit/Create Page with Page
- /PDFKit/PDFKit Print PDF
- /PDFKit/PDFView/PDFView overlay/PDFViewControl overlay
- /PDFKit/Render PDFPage
- /WinFrameworks/Windows PDF Viewer
PDFDocumentMBS.PrintOperation(PrintInfo as Variant, AutoRotate as boolean = true, scalingMode as Integer = 0) as Variant
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | PDFKit | MBS PDFKit Plugin | 14.3 | ✅ Yes | ❌ No | ❌ No | ❌ No | Desktop, Console & Web |
Returns NSPrintOperationMBS object.
PDFDocumentMBS.removePageAtIndex(index as Integer)
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | PDFKit | MBS PDFKit Plugin | 8.0 | ✅ Yes | ❌ No | ❌ No | ✅ Yes | All |
Index is zero based.
Some examples using this method:
PDFDocumentMBS.selectionForEntireDocument as PDFSelectionMBS
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | PDFKit | MBS PDFKit Plugin | 8.0 | ✅ Yes | ❌ No | ❌ No | ✅ Yes | All |
PDFDocumentMBS.selectionFromPage(StartPage as PDFPageMBS, StartCharacterIndex as Integer, EndPage as PDFPageMBS, EndCharacterIndex as Integer) as PDFSelectionMBS
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | PDFKit | MBS PDFKit Plugin | 8.0 | ✅ Yes | ❌ No | ❌ No | ✅ Yes | All |
Start and end page can be the same.
See also:
PDFDocumentMBS.selectionFromPage(StartPage as PDFPageMBS, StartPointX as single, StartPointY as single, EndPage as PDFPageMBS, EndPointX as single, EndPointY as single) as PDFSelectionMBS
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | PDFKit | MBS PDFKit Plugin | 8.0 | ✅ Yes | ❌ No | ❌ No | ✅ Yes | All |
Points are in page-space and relative to their respective pages. Start and end page can be the same (and are then equivalent to calling selectionFromPointToPoint).
See also:
PDFDocumentMBS.SetDelegate(d as PDFDocumentDelegateMBS)
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | PDFKit | MBS PDFKit Plugin | 8.0 | ✅ Yes | ❌ No | ❌ No | ✅ Yes | All |
PDFDocumentMBS.SetKeywords(keywords() as string)
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | PDFKit | MBS PDFKit Plugin | 8.0 | ✅ Yes | ❌ No | ❌ No | ✅ Yes | All |
PDFDocumentMBS.unlockWithPassword(password as string) as boolean
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | PDFKit | MBS PDFKit Plugin | 8.0 | ✅ Yes | ❌ No | ❌ No | ✅ Yes | All |
Means of passing in a password to unlock encrypted PDF's. Calling unlockWithPassword will attempt to unlock the PDF. If successful, a DidUnlockDocument event is sent to the delegate. You cannot "re-lock" a PDF by passing in a bogus password. Returns true if the document is now unlocked, false otherwise (isLocked = false).
PDFDocumentMBS.write(file as folderitem, QuartzFilter as Variant = nil) as boolean
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | PDFKit | MBS PDFKit Plugin | 11.2 | ✅ Yes | ❌ No | ❌ No | ✅ Yes | All |
Returns true on success and false on failure.
There is a bug known in Mac OS X 10.4 that this function may return true even if the saving failed. So you may prefer to check the file whether it exists after write.
Optional for Mac OS X 10.6, you can pass a QuartzFilterMBS object to use that filter here.
Looks like newer macOS versions like 10.14 or later ignore the quartz filter.
PDFDocumentMBS.writeWithOptions(file as folderitem, options as dictionary) as boolean
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | PDFKit | MBS PDFKit Plugin | 19.1 | ✅ Yes | ❌ No | ❌ No | ✅ Yes | All |
Returns true on success and false on failure.
Some keys to use include:
CGPDFContextMBS.kCGPDFContextUserPassword
CGPDFContextMBS.kCGPDFContextTitle
CGPDFContextMBS.kCGPDFContextSubject
CGPDFContextMBS.kCGPDFContextOwnerPassword
CGPDFContextMBS.kCGPDFContextOutputIntents
CGPDFContextMBS.kCGPDFContextOutputIntent
CGPDFContextMBS.kCGPDFContextKeywords
CGPDFContextMBS.kCGPDFContextEncryptionKeyLength
CGPDFContextMBS.kCGPDFContextCreator
CGPDFContextMBS.kCGPDFContextAuthor
CGPDFContextMBS.kCGPDFContextAllowsPrinting
CGPDFContextMBS.kCGPDFContextAllowsCopying
The items on this page are in the following plugins: MBS PDFKit Plugin.