MBS Xojo Plugins, version 19.4pr8

New in this prerelease of the 19.4 plugins:
  • Updated DynaPDF to version
  • Improved RemoveHTMLTagsMBS to ignore greater than or smaller than characters in quoted text.
  • Added YieldTicks shared property to FileListMBS class.
  • Added TagLibFileRefMBS SetProperties, e.g. to change ID3v2 tags in MP3 files.
Download: monkeybreadsoftware.com/xojo/download/plugin/Prerelease/.
Or ask us to be added to our shared Dropbox folder.

Four ways to save picture as Tiff in Xojo

Depending on your needs, we can offer four different ways to save a picture in tiff (and other) formats.

NSImageMBS is a high level class for handling images on MacOS and it can save in various formats. CGImageDestinationMBS offers a way to export in something like 20 formats on MacOS and iOS (public.jpeg, public.png, com.compuserve.gif, public.tiff, public.jpeg-2000, com.apple.atx, org.khronos.ktx, org.khronos.astc, public.heic, com.microsoft.ico, com.microsoft.bmp, com.apple.icns, com.adobe.photoshop-image, com.adobe.pdf, com.truevision.tga-image, com.ilm.openexr-image, public.pbm, public.pvr).

For cross platform projects, you can for example try GMImageMBS class, which can write in over 100 formats. If you need tiff specific details, you may want to check our dedicated TiffPictureMBS class, which allows you to control all details and lets you set individual header fields.

Dim p As Picture = LogoMBS(500) // 1. NSImageMBS Dim n As New NSImageMBS(p) Dim tiff As String = n.TIFFRepresentation Dim file1 As FolderItem = SpecialFolder.Desktop.Child("test1.tif") Dim b As BinaryStream = BinaryStream.Create(file1) b.Write tiff b.Close // 2. CGImageDestinationMBS Dim image As CGImageMBS = CGImageMBS.CreateImage(p) Dim file2 As FolderItem = SpecialFolder.Desktop.Child("test2.tif") Dim dest As CGImageDestinationMBS = CGImageDestinationMBS.CreateWithFile(file2, "public.tiff", 1) dest.AddImage(image, Nil) If dest.Finalize Then // MsgBox "Saved" Else MsgBox "Failed to save." End If // 3. GMImageMBS Dim gmimage As New GMImageMBS(p) Dim file3 As FolderItem = SpecialFolder.Desktop.Child("test3.tif") gmimage.write(file3) // 4. TiffPictureMBS Dim t As New TiffPictureMBS Dim file4 As FolderItem = SpecialFolder.Desktop.Child("test4.tif") t.Pict = p If t.Create(file4) Then If t.WriteRGB Then t.Close // ok Else Break End If Else Break End If
Please do not hesitate to contact us with questions. And bring your projects with questions to the Xojo conferences to talk directly to us or Xojo engineers.

TagLib to write ID3v2 Tags in Xojo

As you may know, we use TagLib, an open source library to read metadata from audio files, e.g. ID3 tags.

With our TagLibFileRefMBS class you can read properties of an audio file including all the common values like artist, title, album or comment. We now got a setProperties method to update the properties and add/change/delete a few. Just pass in the dictionary with changes. Keys with nil values remove an entry and otherwise add or replace it:

Dim file As FolderItem = SpecialFolder.Desktop.Child("test.mp3") Dim tag As New TagLibFileRefMBS(file) Dim dic As Dictionary = tag.Properties Break // inspect dictionary dic.Value("ARTIST") = "John Doe" dic.Value("ALBUM") = Nil // clear this one tag.SetProperties(dic) If tag.Save Then MsgBox "OK" Else MsgBox "Failed to save" End If
Currently TagLib supports both ID3v1 and ID3v2 for MP3 files, Ogg Vorbis comments and ID3 tags and Vorbis comments in FLAC, MPC, Speex, WavPack, TrueAudio, WAV, AIFF, MP4 and ASF files.

MBS Xojo Plugins, version 19.4pr7

New in this prerelease of the 19.4 plugins:
  • Added allowsMagnification and magnification properties as well as setMagnification method for WKWebViewControlMBS control.
  • Added SSL connection modes for CubeSQL client in MBS Xojo SQL Plugin.
  • Updated CubeSQL client to version 5.8.3.
  • Added Picture and CGImage properties to ICScannerBandDataMBS class.
  • Updated DynaPDF to version
  • Added NoSSL parameter for SetupAWS function in CURLSMBS class.
  • Added Hash function for GMImageMBS class.
  • Added MacROMBootVersion and MacBoardID functions to SystemInformationMBS class.
  • Added setStartDate and setEndDate for EKEventMBS and CalEventMBS classes, so you can specify which time zone to use for converting between Date and NSDate.
  • Added scale for alpha channel pictures for ScaleImageAndMaskMBS, ScaleMBS, ScalingMBS functions in Picture class.
  • Updated CURL library to version 7.66.0.
  • Added more properties to CURLSVersionMBS class.
  • Added OptionSASLAuthZID property, kHTTP_VERSION_3 and kError_Auth_Error constants to CURLSMBS class.
Download: monkeybreadsoftware.com/xojo/download/plugin/Prerelease/.
Or ask us to be added to our shared Dropbox folder.

WIA Error Codes

If you use WIA classes in MBS Xojo Win Plugin or WIA functions in MBS FileMaker Plugin, you may run into some Windows specific error codes. They all start with hex 8021 and below is a list of Windows Image Acquisition (WIA) error codes.

See also blog articles:
Error CodeMeaningHex CodeDecimal
WIA_ERROR_BUSYThe device is busy. Close any apps that are using this device or wait for it to finish and then try again.80210006-2145320954
WIA_ERROR_COVER_OPENOne or more of the device’s cover is open.80210016-2145320938
WIA_ERROR_DEVICE_COMMUNICATIONCommunication with the WIA device failed. Make sure that the device is powered on and connected to the PC. If the problem persists, disconnect and reconnect the device.8021000A-2145320950
WIA_ERROR_DEVICE_LOCKEDThe device is locked. Close any apps that are using this device or wait for it to finish and then try again.8021000D-2145320947
WIA_ERROR_EXCEPTION_IN_DRIVERThe device driver threw an exception.8021000E-2145320946
WIA_ERROR_GENERAL_ERRORAn unknown error has occurred with the WIA device.80210001-2145320959
WIA_ERROR_INCORRECT_HARDWARE_ SETTINGThere is an incorrect setting on the WIA device.8021000C-2145320948
WIA_ERROR_INVALID_COMMANDThe device doesn't support this command.8021000B-2145320949
WIA_ERROR_INVALID_DRIVER_RESPONSEThe response from the driver is invalid.8021000F-2145320945
WIA_ERROR_ITEM_DELETEDThe WIA device was deleted. It's no longer available.80210009-2145320951
WIA_ERROR_LAMP_OFFThe scanner's lamp is off.80210017-2145320937
WIA_ERROR_MAXIMUM_PRINTER_ ENDORSER_COUNTERA scan job was interrupted because an Imprinter/Endorser item reached the maximum valid value for WIA_IPS_PRINTER_ENDORSER_COUNTER, and was reset to 0. This feature is available with Windows 8 and later versions of Windows.80210021-2145320927
WIA_ERROR_MULTI_FEEDA scan error occurred because of a multiple page feed condition. This feature is available with Windows 8 and later versions of Windows.80210020-2145320928
WIA_ERROR_OFFLINEThe device is offline. Make sure the device is powered on and connected to the PC.80210005-2145320955
WIA_ERROR_PAPER_EMPTYThere are no documents in the document feeder.80210003-2145320957
WIA_ERROR_PAPER_JAMPaper is jammed in the scanner's document feeder.80210002-2145320958
WIA_ERROR_PAPER_PROBLEMAn unspecified problem occurred with the scanner's document feeder.80210004-2145320956
WIA_ERROR_WARMING_UPThe device is warming up.80210007-2145320953
WIA_ERROR_USER_INTERVENTIONThere is a problem with the WIA device. Make sure that the device is turned on, online, and any cables are properly connected.80210008-2145320952
WIA_S_NO_DEVICE_AVAILABLENo scanner device was found. Make sure the device is online, connected to the PC, and has the correct driver installed on the PC.80210015-2145320939

MBS Xojo Plugins, version 19.4pr6

New in this prerelease of the 19.4 plugins:
  • Changed SQL Plugin functions for ODBC on Mac to not complain about missing SQLBrowseConnect.
  • Added LZ4MBS module.
  • Improvements for next Xojo version.
  • Added Name and Signature properties to JavaFieldMBS and JavaMethodMBS classes.
  • Added CallStaticMethod for JavaClassMBS, CallMethod and CallNonvirtualMethod for JavaObjectMBS taking parameters as Variants.
  • Added Field to JavaObjectMBS and StaticField to JavaClassMBS to get/set fields with variants.
  • Added NewObject function to JavaClassMBS to pass parameters to constructor as variants.
  • Added StringValue and Operator_Convert to JavaStringMBS class.
  • Updated Graphics support in DynaPDFMBS class for next version of Xojo.
Download: monkeybreadsoftware.com/xojo/download/plugin/Prerelease/.
Or ask us to be added to our shared Dropbox folder.

LZ4 Extremely fast compression for Xojo

For next MBS Xojo Plugin, we add a LZ4 compression module called LZ4MBS. LZ4 is a lossless compression algorithm with high performance.

We have Compress and Decompress methods for handling data in string and MemoryBlocks in Xojo:

Dim m As String = "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Lorem ipsum dolor site amat." // make sure encoding is set m = ConvertEncoding(m, encodings.UTF8) // compress Dim c As String = LZ4MBS.Compress(m) // decompress Dim d As String = LZ4MBS.Decompress(c) // set encoding after decompressing d = DefineEncoding(d, encodings.UTF8) // and check If d = m Then MsgBox "Text match" Else MsgBox "Text doesn't match" End If
You can download 19.4pr6 in the next days and try it. Please contact us if you have questions.

Upgrading our Java Support for Xojo

With MBS Plugin 19.4 we will include newer Java methods to make your live easier when working with Java classes in Xojo. Instead of passing arguments as memoryblock or checking which of the various methods to use, we simply use variants.

For fields, you can now use Field() or StaticField() methods to get or set the values. Values are passed as variant and we check which type is needed and do required conversions. All the normal data types should work fine this way like integers, floats, booleans or strings. You can pass/receive JavaObjectMBS and subclasses of course. And for arrays please use the JavaArrayMBS subclasses. As a convenience you can pass in Java string with a Xojo string and we create the java string for you.

For method calls, we got CallMethod, CallNonvirtualMethod and CallStaticMethod to call methods and pass arguments as array of variants. Same for NewObject method to create a new object by calling the constructor.

We add to JavaObjectMBS class:

Field(TheField as JavaFieldMBS) as Variant
CallMethod(MethodID as JavaMethodMBS, args() as Variant) as Variant
CallNonvirtualMethod(TheClass as JavaClassMBS, MethodID as JavaMethodMBS, args() as Variant) as Variant

and to JavaClassMBS class:

StaticField(TheField as JavaFieldMBS) as Variant
NewObject(MethodID as JavaMethodMBS, args() as Variant) as JavaObjectMBS
CallStaticMethod(MethodID as JavaMethodMBS, args() as Variant) as Variant

We hope you enjoy the new freedom to not build memoryblocks for parameters and let the plugin do the heavy work. Please don't hesitate to send us questions.

MBS Xojo Plugins, version 19.4pr5

New in this prerelease of the 19.4 plugins:
  • Fixed a problem with ActualTech ODBC drivers to connect from Mac to Microsoft SQL server.
  • Fixed CDArrayMBS.percentile to return double.
  • Fixed a bug in WordFileMBS class where it would not update the modified XML correctly for replace in header section.
  • Updated zint library to version 2.6.5.
  • Added barcode type Ultra.
  • Fixed GMImageMBS functions to return picture to better work with GIF images.
  • Fixed possible crash situation with SQL Plugin pinging server in background.
  • Added systemIndigoColor and systemTealColor to NSColorMBS class.
  • Updated ChartDirector to a newer version which loads fonts on MacOS Catalina.
Download: monkeybreadsoftware.com/xojo/download/plugin/Prerelease/.
Or ask us to be added to our shared Dropbox folder.

Xojo Developer Magazine 17.5 Issue

The September/October (17.5) issue of xDev Magazine is now available. Here's a quick preview of what's inside:

Numbers Please! Part 4 by Markus Winter
What is a number? And just how do you tell a program to detect a number? It's much more complicated than you'd think -- hope you like Regex formulas!

What's New in the MBS Plugins by Stefanie Juchmes
Based on Christian's talk at the Miami Xojo Conference, Stefanie covers many new aspects of the Monkeybread Plugins you might have missed.

Maps (Part 1) by Markus Winter
Would you like to include maps in your application? Be careful, as what used to be free now costs a fortune. Markus sets the stage for saving money by switching to Apple Maps.

Your First Web App -- Part 2 by Paul Budd
Paul continues to build his Web app, this time incorporating the functionality of adding records, searching, and using SQL prepared statements.

PLUS: Shared properties, power user features, standard operating procedures, Best of the Web, and more!

Currency Data Type

Xojo features a data type called currency. It is used for storing currency values and uses internally a 64bit value. As 4 digits are reserved for right of the dot, the 1.0 value is stored internally as 10000. When converting between double and integer, values are divided/multiplied by 10000.

There is a problem:
Double values are only precise for 15 digits, so having a big value like 123456789012345.1234 in a currency will not work correctly, as this can't be stored in a double. You get 123456789012345.1136. There are rounding issues.

But some of use need to work with huge numbers and functions like val() internally use double, so there are rounding issues with parsing.

For next plugin we'll add a function CurrencyValueMBS to fix that. Our CurrencyValueMBS function will return currency values parsed up to "+922337203685477.5807" just fine. If value is out of range, we raise an exception, so you can track down errors.

12 years of MBS Xojo DynaPDF Plugin

About 12 years ago we started the development of our DynaPDF Plugin.

After a year of development, the plugin was released to the public on 1st Sep 2007 with MBS Plugin 7.6pr1.

This plugin has been a big success for us and provides the PDF engine to thousands of Xojo applications around the world. Based on user feedback we got a lot of functions over the years like the raster engine, PDF/A conversion and ZUGFeRD support.

Please make sure you try the plugin, make it part of your toolbox and start to enjoy all the PDF features you can add to your application.

Barcodes supported by MBS Plugins

MBS Plugin supports generating over 80 barcode types, so we made a new graphics to show a few common barcodes:

Wether you need to make UPC or EAN in various versions, QR Code in normal or micro size, we cover them all.

Available with Barcode functions in our MBS FileMaker Plugin and in BarcodeGeneratorMBS class in our MBS Xojo Barcode Plugin.


Sep 2019
Aug 2019
Jul 2019
Jun 2019
May 2019
Apr 2019
Mar 2019
Feb 2019
Jan 2019
Dec 2018
Nov 2018
Oct 2018
Sep 2018
Aug 2018
Jul 2018
Jun 2018
May 2018
Apr 2018
Mar 2018
Feb 2018
Jan 2018
Dec 2017
Nov 2017
Oct 2017
Sep 2017
Aug 2017
Jul 2017
Jun 2017
May 2017
Apr 2017
Mar 2017
Feb 2017
Jan 2017
Dec 2016
Nov 2016
Oct 2016
Sep 2016
Aug 2016
Jul 2016
Jun 2016
May 2016
Apr 2016
Mar 2016
Feb 2016
Jan 2016
Dec 2015
Nov 2015
Oct 2015
Sep 2015
Aug 2015
Jul 2015
Jun 2015
May 2015
Apr 2015
Mar 2015
Feb 2015
Jan 2015
Dec 2014
Nov 2014
Oct 2014
Sep 2014
Aug 2014
Jul 2014
Jun 2014
May 2014
Apr 2014
Mar 2014
Feb 2014
Jan 2014
Dec 2013
Nov 2013
Oct 2013
Sep 2013
Aug 2013
Jul 2013
Jun 2013
May 2013
Apr 2013
Mar 2013
Feb 2013
Jan 2013
Dec 2012
Nov 2012
Oct 2012
Sep 2012
Aug 2012
Jul 2012
Jun 2012
May 2012
Apr 2012
Mar 2012
Feb 2012
Jan 2012
Dec 2011
Nov 2011
Oct 2011
Sep 2011
Aug 2011
Jul 2011
Jun 2011
May 2011
Apr 2011
Mar 2011
Feb 2011
Jan 2011
Dec 2010
Nov 2010
Oct 2010
Sep 2010
Aug 2010
Jul 2010
Jun 2010
May 2010
Apr 2010
Mar 2010
Feb 2010
Jan 2010
Dec 2009
Nov 2009
Oct 2009
Sep 2009
Aug 2009
Jul 2009
Apr 2009
Mar 2009
Feb 2009
Dec 2008
Nov 2008
Oct 2008
Aug 2008
May 2008
Apr 2008
Mar 2008
Feb 2008