MBS Plugin Documentation

Search:

Statistics   -   FAQ   -   Plugin Parts (All, Dependencies)   -   Class hierarchie

New in Version 7.0 7.1 7.2 7.3 7.4 7.5 7.6 7.7 7.8 8.0 8.1 8.2 8.3 8.4 8.5 8.6 8.7 9.0

The list of the   themes,   classes,   controls,   modules,   global methods by category,   global methods by name,   screenshots,   licenses   and   examples.

Platforms to show: All Mac Windows Linux Cross-Platform

PDFDocumentMBS.allowsCopying as boolean
method, PDFKit, MBS Cocoa Plugin (PDFKit), class PDFDocumentMBS, Console safe, Plugin version: 7.6, Mac OS X: Works, Windows: Does nothing, Linux x86: Does nothing, Feedback.

Function: Whether copying is allowed.
Notes: Even unlocked, encrypted PDF's may have certain restrictions regarding copying or printing placed upon them.
PDFDocumentMBS.allowsPrinting as boolean
method, PDFKit, MBS Cocoa Plugin (PDFKit), class PDFDocumentMBS, Console safe, Plugin version: 7.6, Mac OS X: Works, Windows: Does nothing, Linux x86: Does nothing, Feedback.

Function: Whether printing is allowed.
Notes: Even unlocked, encrypted PDF's may have certain restrictions regarding copying or printing placed upon them.
PDFDocumentMBS.Author as string
method, PDFKit, MBS Cocoa Plugin (PDFKit), class PDFDocumentMBS, Console safe, Plugin version: 7.6, Mac OS X: Works, Windows: Does nothing, Linux x86: Does nothing, Feedback.

Function: String containing document author.
Notes: (Read and Write runtime property)
PDFDocumentMBS.beginFindString(text as string, options as integer)
method, PDFKit, MBS Cocoa Plugin (PDFKit), class PDFDocumentMBS, Console safe, Plugin version: 7.6, Mac OS X: Works, Windows: Does nothing, Linux x86: Does nothing, Feedback.

Function: Begins a find, searching the document for string.
Notes: Search results are handled via a DidFindMatch event in the delegate. Supported options are: NSCaseInsensitiveSearch, NSLiteralSearch, and NSBackwardsSearch.
PDFDocumentMBS.cancelFindString
method, PDFKit, MBS Cocoa Plugin (PDFKit), class PDFDocumentMBS, Console safe, Plugin version: 7.6, Mac OS X: Works, Windows: Does nothing, Linux x86: Does nothing, Feedback.

Function: Method to cancel a search.
Notes: Can be called from a user method being serviced by a find notification.
class PDFDocumentMBS
class, PDFKit, MBS Cocoa Plugin (PDFKit), class PDFDocumentMBS, Console safe, Plugin version: 7.6, Mac OS X: Works, Windows: Does nothing, Linux x86: Does nothing, Feedback.

Function: The PDFKit class for a PDF document.
Notes: Basicly this is the code used by Preview.app by Apple.
PDFDocumentMBS.Constructor
method, PDFKit, MBS Cocoa Plugin (PDFKit), class PDFDocumentMBS, Console safe, Plugin version: 8.0, Mac OS X: Works, Windows: Does nothing, Linux x86: Does nothing, Feedback.

Function: The constructor to create a new empty pdf document.
Example:
dim file1,file2,file3,destfile as FolderItem
dim page1,page2,page3 as PDFPageMBS
dim doc1,doc2 as PDFDocumentMBS
dim img as NSImageMBS
dim doc as PDFDocumentMBS

file1=DesktopFolder.Child("test1.pdf")
file2=DesktopFolder.Child("test2.pdf")
file3=DesktopFolder.Child("logo.jpg")

doc1=new PDFDocumentMBS(file1)
doc2=new PDFDocumentMBS(file2)

MsgBox str(doc1.pageCount)

img=new NSImageMBS(file3)

Backdrop=img.CopyPicture

page1=new PDFPageMBS(img)
page2=doc1.pageAtIndex(0)
page3=doc2.pageAtIndex(0)

doc=new PDFDocumentMBS
doc.insertPage page1,0
doc.insertPage page2,1
doc.insertPage page3,2

destfile=DesktopFolder.Child("test.pdf")
call doc.write(destfile)


PDFDocumentMBS.Constructor(data as string)
method, PDFKit, MBS Cocoa Plugin (PDFKit), class PDFDocumentMBS, Console safe, Plugin version: 7.6, Mac OS X: Works, Windows: Does nothing, Linux x86: Does nothing, Feedback.

Function: The constructor to create a new pdf document based on a string.
PDFDocumentMBS.Constructor(file as folderitem)
method, PDFKit, MBS Cocoa Plugin (PDFKit), class PDFDocumentMBS, Console safe, Plugin version: 7.6, Mac OS X: Works, Windows: Does nothing, Linux x86: Does nothing, Feedback.

Function: The constructor to create a new pdf document based on a file.
Example:
dim p as PDFDocumentMBS
dim f as FolderItem

f=DesktopFolder.Child("test.pdf")
p=new PDFDocumentMBS(f)

MsgBox "Text from first page:"+EndOfLine+EndOfLine+p.pageAtIndex(0).stringValue

PDFDocumentMBS.CreationDate as Date
method, PDFKit, MBS Cocoa Plugin (PDFKit), class PDFDocumentMBS, Console safe, Plugin version: 7.6, Mac OS X: Works, Windows: Does nothing, Linux x86: Does nothing, Feedback.

Function: Date representing document creation date.
Notes: (Read and Write runtime property)
PDFDocumentMBS.Creator as string
method, PDFKit, MBS Cocoa Plugin (PDFKit), class PDFDocumentMBS, Console safe, Plugin version: 7.6, Mac OS X: Works, Windows: Does nothing, Linux x86: Does nothing, Feedback.

Function: String containing name of app that created document content.
Notes: (Read and Write runtime property)
PDFDocumentMBS.dataRepresentation as string
method, PDFKit, MBS Cocoa Plugin (PDFKit), class PDFDocumentMBS, Console safe, Plugin version: 7.6, Mac OS X: Works, Windows: Does nothing, Linux x86: Does nothing, Feedback.

Function: Methods to record the current state of the PDFDocument as data string.
PDFDocumentMBS.documentURL as string
method, PDFKit, MBS Cocoa Plugin (PDFKit), class PDFDocumentMBS, Console safe, Plugin version: 7.6, Mac OS X: Works, Windows: Does nothing, Linux x86: Does nothing, Feedback.

Function: The document location.
Notes: May return nil if the document was created from data.
PDFDocumentMBS.exchangePageAtIndexWithPageAtIndex(indexA as integer, indexB as integer)
method, PDFKit, MBS Cocoa Plugin (PDFKit), class PDFDocumentMBS, Console safe, Plugin version: 7.6, Mac OS X: Works, Windows: Does nothing, Linux x86: Does nothing, Feedback.

Function: Exchanges the two pages with the given index.
Notes: Index is zero based.
PDFDocumentMBS.findString(text as string, options as integer) as PDFSelectionArrayMBS
method, PDFKit, MBS Cocoa Plugin (PDFKit), class PDFDocumentMBS, Console safe, Plugin version: 7.6, Mac OS X: Works, Windows: Does nothing, Linux x86: Does nothing, Feedback.

Function: Searches entire document for string and returns an array of PDFSelections representing all instances found.
Example:
dim p as PDFDocumentMBS
dim f as FolderItem
dim sa as PDFSelectionArrayMBS
dim i,c as integer
dim s as PDFSelectionMBS

const NSCaseInsensitiveSearch=1

f=DesktopFolder.Child("test.pdf")
p=new PDFDocumentMBS(f)

if p.pageCount=0 then
MsgBox "Failed to load the PDF."
Return
end if

sa=p.findString("Plugin",NSCaseInsensitiveSearch)

if sa=nil then
MsgBox "no item found."
else
MsgBox str(sa.Count)+" items found."
end if

s=sa.Item(0)
s.extendSelectionAtEnd(50)
s.extendSelectionAtStart(50)

MsgBox s.stringValue // shows a bit more text before and after the location found

Notes:
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
method, PDFKit, MBS Cocoa Plugin (PDFKit), class PDFDocumentMBS, Console safe, Plugin version: 7.6, Mac OS X: Works, Windows: Does nothing, Linux x86: Does nothing, Feedback.

Function: Searches for only the next instance of string beginning after the last character of selection with options (or preceding the first character of the selection if NSBackwardsSearch is specified as a search option).
Notes: 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
method, PDFKit, MBS Cocoa Plugin (PDFKit), class PDFDocumentMBS, Console safe, Plugin version: 7.6, Mac OS X: Works, Windows: Does nothing, Linux x86: Does nothing, Feedback.

Function: Given a PDFPage, returns the pages index within the document.
Notes: Indicees are zero-based.
PDFDocumentMBS.insertPage(page as PDFPageMBS, index as integer)
method, PDFKit, MBS Cocoa Plugin (PDFKit), class PDFDocumentMBS, Console safe, Plugin version: 7.6, Mac OS X: Works, Windows: Does nothing, Linux x86: Does nothing, Feedback.

Function: Inserts a page in the pdf on the given index.
Notes: Index is zero based.
PDFDocumentMBS.isEncrypted as boolean
method, PDFKit, MBS Cocoa Plugin (PDFKit), class PDFDocumentMBS, Console safe, Plugin version: 7.6, Mac OS X: Works, Windows: Does nothing, Linux x86: Does nothing, Feedback.

Function: Whether the PDF is encrypted.
Notes:
With the right password, a PDF can be unlocked - nontheless, the PDF still indicates that it is encrypted - just no longer locked. Some PDF's may be encrypted but can be unlocked with the empty string.
These are unlocked automatically.
PDFDocumentMBS.isFinding as boolean
method, PDFKit, MBS Cocoa Plugin (PDFKit), class PDFDocumentMBS, Console safe, Plugin version: 7.6, Mac OS X: Works, Windows: Does nothing, Linux x86: Does nothing, Feedback.

Function: Returns true if document is currently searching for a string.
PDFDocumentMBS.isLocked as boolean
method, PDFKit, MBS Cocoa Plugin (PDFKit), class PDFDocumentMBS, Console safe, Plugin version: 7.6, Mac OS X: Works, Windows: Does nothing, Linux x86: Does nothing, Feedback.

Function: Whether the PDF is locked.
Notes:
With the right password, a PDF can be unlocked - nontheless, the PDF still indicates that it is encrypted - just no longer locked. Some PDF's may be encrypted but can be unlocked with the empty string.
These are unlocked automatically.
PDFDocumentMBS.Keywords as PDFStringArrayMBS
method, PDFKit, MBS Cocoa Plugin (PDFKit), class PDFDocumentMBS, Console safe, Plugin version: 7.6, Mac OS X: Works, Windows: Does nothing, Linux x86: Does nothing, Feedback.

Function: Array of Strings containing document keywords.
PDFDocumentMBS.majorVersion as integer
method, PDFKit, MBS Cocoa Plugin (PDFKit), class PDFDocumentMBS, Console safe, Plugin version: 7.6, Mac OS X: Works, Windows: Does nothing, Linux x86: Does nothing, Feedback.

Function: PDF version of the PDF file (example: major version = 1, minor = 4; PDF v1.4).
PDFDocumentMBS.minorVersion as integer
method, PDFKit, MBS Cocoa Plugin (PDFKit), class PDFDocumentMBS, Console safe, Plugin version: 7.6, Mac OS X: Works, Windows: Does nothing, Linux x86: Does nothing, Feedback.

Function: PDF version of the PDF file (example: major version = 1, minor = 4; PDF v1.4).
PDFDocumentMBS.ModificationDate as Date
method, PDFKit, MBS Cocoa Plugin (PDFKit), class PDFDocumentMBS, Console safe, Plugin version: 7.6, Mac OS X: Works, Windows: Does nothing, Linux x86: Does nothing, Feedback.

Function: Date representing last document modification date.
Notes: (Read and Write runtime property)
PDFDocumentMBS.NSBackwardsSearch=4
const, PDFKit, MBS Cocoa Plugin (PDFKit), class PDFDocumentMBS, Plugin version: 7.6, Mac OS X: Works, Windows: Does nothing, Linux x86: Does nothing, Feedback.

Function: One of the Cocoa search modes.
Notes: Performs searching from the end of the range toward the beginning.
PDFDocumentMBS.NSCaseInsensitiveSearch=1
const, PDFKit, MBS Cocoa Plugin (PDFKit), class PDFDocumentMBS, Plugin version: 7.6, Mac OS X: Works, Windows: Does nothing, Linux x86: Does nothing, Feedback.

Function: One of the Cocoa search modes.
Notes: Ignores case distinctions among characters.
PDFDocumentMBS.NSLiteralSearch=2
const, PDFKit, MBS Cocoa Plugin (PDFKit), class PDFDocumentMBS, Plugin version: 7.6, Mac OS X: Works, Windows: Does nothing, Linux x86: Does nothing, Feedback.

Function: One of the Cocoa search modes.
Notes: Performs a byte-for-byte comparison. Differing literal sequences (such as composed character sequences) that would otherwise be considered equivalent are considered not to match. Using this option can speed some operations dramatically.
PDFDocumentMBS.outlineItemForSelection(selection as PDFSelectionMBS) as PDFOutlineMBS
method, PDFKit, MBS Cocoa Plugin (PDFKit), class PDFDocumentMBS, Console safe, Plugin version: 7.6, Mac OS X: Works, Windows: Does nothing, Linux x86: Does nothing, Feedback.

Function: Given a PDFSelection, this method returns the child outline item the selection most closely falls beneath.
Notes:
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.outlineRoot as PDFOutlineMBS
method, PDFKit, MBS Cocoa Plugin (PDFKit), class PDFDocumentMBS, Console safe, Plugin version: 7.6, Mac OS X: Works, Windows: Does nothing, Linux x86: Does nothing, Feedback.

Function: Returns the root outline object for the PDF (or nil if none).
PDFDocumentMBS.pageAtIndex(index as integer) as PDFPageMBS
method, PDFKit, MBS Cocoa Plugin (PDFKit), class PDFDocumentMBS, Console safe, Plugin version: 7.6, Mac OS X: Works, Windows: Does nothing, Linux x86: Does nothing, Feedback.

Function: Returns a PDFPage object representing the page at index.
Example:
dim p as PDFDocumentMBS
dim f as FolderItem

f=DesktopFolder.Child("test.pdf")
p=new PDFDocumentMBS(f)

MsgBox "Text from first page:"+EndOfLine+EndOfLine+p.pageAtIndex(0).stringValue

Notes: Will raise an exception if index is out of bounds. Indicees are zero-based.
PDFDocumentMBS.pageCount as integer
method, PDFKit, MBS Cocoa Plugin (PDFKit), class PDFDocumentMBS, Console safe, Plugin version: 7.6, Mac OS X: Works, Windows: Does nothing, Linux x86: Does nothing, Feedback.

Function: The number of pages in the document.
PDFDocumentMBS.Producer as string
method, PDFKit, MBS Cocoa Plugin (PDFKit), class PDFDocumentMBS, Console safe, Plugin version: 7.6, Mac OS X: Works, Windows: Does nothing, Linux x86: Does nothing, Feedback.

Function: String containing name of app that produced PDF data.
Notes: (Read and Write runtime property)
PDFDocumentMBS.removePageAtIndex(index as integer)
method, PDFKit, MBS Cocoa Plugin (PDFKit), class PDFDocumentMBS, Console safe, Plugin version: 7.6, Mac OS X: Works, Windows: Does nothing, Linux x86: Does nothing, Feedback.

Function: Removes a page in the pdf on the given index.
Notes: Index is zero based.
PDFDocumentMBS.selectionForEntireDocument as PDFSelectionMBS
method, PDFKit, MBS Cocoa Plugin (PDFKit), class PDFDocumentMBS, Console safe, Plugin version: 7.6, Mac OS X: Works, Windows: Does nothing, Linux x86: Does nothing, Feedback.

Function: Returns a selection representing text for the entire document.
PDFDocumentMBS.selectionFromPage(StartPage as PDFPageMBS, StartCharacterIndex as integer, EndPage as PDFPageMBS, EndCharacterIndex as integer)
method, PDFKit, MBS Cocoa Plugin (PDFKit), class PDFDocumentMBS, Console safe, Plugin version: 7.6, Mac OS X: Works, Windows: Does nothing, Linux x86: Does nothing, Feedback.

Function: Returns a selection representing text from page startPage and point StartCharacterIndex to page endPage and to point EndCharacterIndex on that page.
Notes: Start and end page can be the same.
PDFDocumentMBS.selectionFromPage(StartPage as PDFPageMBS, StartPointX as single, StartPointY as single, EndPage as PDFPageMBS, EndPointX as single, EndPointY as single)
method, PDFKit, MBS Cocoa Plugin (PDFKit), class PDFDocumentMBS, Console safe, Plugin version: 7.6, Mac OS X: Works, Windows: Does nothing, Linux x86: Does nothing, Feedback.

Function: Returns a selection representing text from page startPage and point startPt to page endPage and to point endPt on that page.
Notes: 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).
PDFDocumentMBS.SetDelegate(d as PDFDocumentDelegateMBS)
method, PDFKit, MBS Cocoa Plugin (PDFKit), class PDFDocumentMBS, Console safe, Plugin version: 7.6, Mac OS X: Works, Windows: Does nothing, Linux x86: Does nothing, Feedback.

Function: If a PDFDocument has a delegate, delegate methods may be called for this document.
PDFDocumentMBS.SetKeywords(keywords() as string)
method, PDFKit, MBS Cocoa Plugin (PDFKit), class PDFDocumentMBS, Console safe, Plugin version: 7.6, Mac OS X: Works, Windows: Does nothing, Linux x86: Does nothing, Feedback.

Function: Sets the array of strings containing document keywords.
PDFDocumentMBS.stringValue as string
method, PDFKit, MBS Cocoa Plugin (PDFKit), class PDFDocumentMBS, Console safe, Plugin version: 7.6, Mac OS X: Works, Windows: Does nothing, Linux x86: Does nothing, Feedback.

Function: The text of the document.
Notes: Convenience method. Returns a string representing the entire document (each page's string concatenated with line feeds between pages).
PDFDocumentMBS.Subject as string
method, PDFKit, MBS Cocoa Plugin (PDFKit), class PDFDocumentMBS, Console safe, Plugin version: 7.6, Mac OS X: Works, Windows: Does nothing, Linux x86: Does nothing, Feedback.

Function: String containing document subject.
Notes: (Read and Write runtime property)
PDFDocumentMBS.Title as string
method, PDFKit, MBS Cocoa Plugin (PDFKit), class PDFDocumentMBS, Console safe, Plugin version: 7.6, Mac OS X: Works, Windows: Does nothing, Linux x86: Does nothing, Feedback.

Function: String containing document title.
Notes: (Read and Write runtime property)
PDFDocumentMBS.unlockWithPassword(password as string) as boolean
method, PDFKit, MBS Cocoa Plugin (PDFKit), class PDFDocumentMBS, Console safe, Plugin version: 7.6, Mac OS X: Works, Windows: Does nothing, Linux x86: Does nothing, Feedback.

Function: Unlocks an encrypted PDF with the given password.
Notes: 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) as boolean
method, PDFKit, MBS Cocoa Plugin (PDFKit), class PDFDocumentMBS, Console safe, Plugin version: 7.6, Mac OS X: Works, Windows: Does nothing, Linux x86: Does nothing, Feedback.

Function: Methods to record the current state of the PDFDocument as a file.
Notes:
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.

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