News from the MBS Xojo Plugins in version 26.2
DynaPDF
In this release, DynaPDF is all about the DynaPDF Content Parser. As PDF documents contain pages with content streams, you may be interested to inspect the content with our DynaPDFParserMBS class. You open a PDF document, you import pages into memory and then parse the page. Once you parse them page, you can access the content objects. How this works and what posibilityies you have you learn in the new Article DynaPDF Content Parser.
In DynaPDF, you can also embed tables. In this release, the SetColOrRowSpan methode from the DynaPDFTableMBS class allows you to specify the row height or column width of a cell in your table. In the parameters you first define the cell using its row and column numbers. Next, you specify the height or width of the cell. In the last parameter, you specify whether to use col span (true) or row span (false).
DynaPDF has also recently updated its licensing system. In detail the DynaPDF Starter license now includes encryption, form fields, and digital signatures. Previously, these features were part of the Lite license. If you are interested in these and other updates, we recommend reading the article DynaPDF Starter License Extended and taking a look at the product feature matrix: DynaPDF Starter vs. Lite vs. Pro vs. Enterprise
JSON
In the last release, we introduced the ToToon method from the JSONMBS class, which converts JSON to TOON. TOON is an information format that is particularly well-suited for use with AI communication. It minimizes the number of tokens required for communication. Now, with the new version 26.2, we have added methods that convert TOON to JSON. We hope that the FromToon method, which allows you to pass Toon as text or as a memory block, will further simplify your work with AI.
Barcodes
We have added support for new barcode types in the ZXing library. If you want to specify which barcodes and barcode groups should be read you need the suitable integer that belongs to the typ. You can use the new shared methods, which return the appropriate integer constant for a given barcode format. You now have the option to choose between: All GS1, All Industrial, All Linear, All Matrix, All Readable, All Retail, Aztec, Aztec Code, Aztec Rune, Codabar, Code 128, Code 32, Code 39, Code 39 Extended, Code 39 Standard, Code 93, PDF417, DataBar, DataBar Expanded, DataBar Expanded Stacked, DataBar Limited, DataBar Omni, DataBar Stacked, DataBar Stacked Omni, Data Matrix, DX Film Edge, EAN-13, EAN-2, EAN-5, EAN-8, EAN/UPC, ISBN, ITF, ITF-14, MaxiCode, MicroPDF417, Micro QR Code, None of the barcodes, Other barcodes, Pharmazentralnummer, QR Code, QR Code Model 1 and Model 2, rMQR Code, UPC-A and UPC-E.
In addition to these shared methods, which return the individual integers corresponding to the types specified in the function, we also have a shared method called BarcodeFormatFromString, which returns the corresponding integer when provided with the barcode name.
Var f As Integer = ZxingBarcodeMBS.BarcodeFormatFromString("EAN-13")
If you want to obtain an integer array containing multiple barcode types, use the BarcodeFormatsFromString method and separate the individual barcode types with a pipe.
Var formats() As Integer = ZxingBarcodeMBS.BarcodeFormatsFromString("EAN-8|EAN-13")
You can then use this array again with the setFormats method.
You can also query the supported formats using the shared method supportedFormats. This returns an integer array containing the constants. You can then use BarcodeFormatsToString to convert these back into a list of barcode types.
MBS Plugins supports generating over 80 barcode types, so we made a new graphics to show a few common barcodes:
Zip
You can now use raw mode with the InitZip method from the ZLibCompressMBS class. A Boolean parameter is now available for this purpose, allowing you to specify whether raw mode should be used.
Phidget
There are also minor changes in the Phidget section. You can now read the maximum and minimum data rates in hertz from the MinDataRate and MaxDataRate properties of the PhidgetGyroscopeMBS class. This class can be used in combination with a Phidget device that has a gyroscope chip integrated.
With the new PortSupportsSetSpeed method from the PhidgetHubMBS class, you can also check whether the communication speed of the VINT port can be set. The same class also includes the new PortSupportsAutoSetSpeed method. It indicates whether this VINT port supports Auto Set Speed and returns the supported state.
New functionalities for Mac
The MBS Xojo Plugins in version 26.2 offers some more new features for Mac users.
Natural Language
We've added a new section: Natural Languages. The classes in this section allow us to identify a string that is contextually similar to a given string, for example, to correct spelling errors. This is achieved through vector embeddings using built-in models on macOS/iOS. Feel free to take a look at the new classes: NLContextualEmbeddingMBS, NLContextualEmbeddingResultMBS, NLContextualEmbeddingResultVectorMBS, NLEmbeddingMBS and NLEmbeddingNeighborMBS
Token Count
Already last year, we introduced the Foundation Models section and have continued to expand it. The classes available in this section use Apple's own functionality to run a local large language model. Sometimes it can be important to determine how many tokens a query to an LLM contains. With the new tokenCount method, you can now do this. You can find the method in the SystemLanguageModelsMBS and LanguageModelSessionsMBS classes. The method can process the prompt as text or as an object of the PromptMBS class.
The SystemLanguageModelsMBS class also includes the new ContextSize property. From this, we can determine the maximum number of tokens our LLM supports in a session, including both input prompts and generated responses.
If you're not done with AI yet, check out our article AI Development with the MBS Xojo Plugins and discover everything the MBS plugin has to offer in terms of AI.
QuickLook
The QLPreviewPanelMBS class now includes two new events. The beginPreviewPanel event is triggered when the QuickLook preview panel starts, and the endPreviewPanel event is triggered when the preview panel ends.
Search Field
We also have new features in the DesktopNSSearchFieldControlMBS and NSSearchFieldControlMBS classes. First, we have the new events searchFieldDidEndSearching and searchFieldDidStartSearching. These fire when the search with the search field begins or is completed. Also new are the events cancelButtonRectForBounds, searchButtonRectForBounds, and searchTextRectForBounds. These events fire when the respective area to which they belong is modified. So, for example, if the bounding rectangle for the search button cell is changed, the searchButtonRectForBounds event fires. It provides us with the updated bounding rectangle to use for the search button. In addition, the NSSearchFieldCellMBS class contains methods that can trigger these events, as we can use cancelButtonRectForBounds, searchButtonRectForBounds, and searchTextRectForBounds to query the positioning of the individual areas.
Text Attachments
We have also added a few new properties to the NSTextAttachmentMBS class. The contents property allows us to read the contents of a text attachment or set it as a memory block. With the new fileType property, we can specify the data type of the contents. You can define the bounds of the attachment in the bounds property as an object of the NSRectMBS class. The image property returns an instance of the relevant image class that represents the contents of the text attachment object.
New functionalities for Windows
Last but not least we offer new features for Windows users
UI Automation
We're excited to announce a new set of UIAutomation classes for Xojo in the MBS Xojo Plugins—making it possible to automate and inspect user interfaces on Windows directly from your Xojo applications! With these new classes, you can use Microsoft's UI Automation API to interact with elements of other Windows applications. We explain what this means for you in the article: Introducing UIAutomation Support in MBS Xojo Plugins
WebView
We have added a new method called MoveFocus to the WebView2ControlMBS and DesktopWebView2ControlMBS classes , which allows us to direct focus to our WebView and its elements. WebView changes focus through user interaction, including selecting within a WebView or tabbing into it. For tabbing, the app runs MoveFocus with Next or Previous to align with Tab and Shift+Tab, respectively, when it determines that the WebView is the next tabsable element.
We hope you will also find some interesting new features. We wish you a lot of fun with MBS Xojo Plugins version 26.2. If you have any ideas for new cool features, need a license or have any questions, please contact us.