TraceFile option in MBS Xojo DynaPDF Plugin

If you are looking to debug a problem with your Xojo code using MBS Xojo DynaPDF Plugin, we can help with our trace feature.

Dim pdf As New MyDynapdfMBS
pdf.TraceFile = SpecialFolder.Desktop.Child("dynapdf.txt")

Once you put the TraceFile assignment there, the plugin will open the file and start writing log messages until the PDF is object is done. The output may look like this:

    file: /Users/cs/Desktop/Create PDF.pdf
    Result: true
    DInfo: 4
    Text: "My first Xojo output"
    Result: true
    value: 1
    Result: true
    Result: true
    Name: "Times"
    Style: 1
    Size: 40.000000
    Embed: true
    CP: 39
    Result: 0
    Align: 1
    Text: "My first Xojo output!"
    Result: true
    Result: true
    ProgType: 1
    MaxCount: 1
    ActivePage: 1
    Result: 0
    ActivePage: 1
    Result: 0
    Result: true

Now you see more than you may be calling directly. You see the file path used for creating the PDF with CreateNewPDF function. Then we call SetDocInfo to set the subject field for the PDF. We set page coordinate system and append a page, which implicitly clears page graphics. Next we set a font and write something and you see all the details like the code page 39, which is unicode. We close the page, which clears page graphics again in case you used it. We close the file and save it, which invokes optionally the progress events until the destructor runs finally and ends the trace file.

If you build a complex PDF and you call thousands of DynaPDF functions, this log may help you to find the errors by looking for error messages or result codes here.

Formatting and error checking expressions in FileMaker

You may be designing databases, which store FileMaker calculations in fields to evaluate them later. This may be to feed the MBS FileMaker Plugin functions like HotKey.SetEvaluate, MenuItem.SetEvaluate, SyntaxColoring.AddContextMenuCommand or one of the many others which take an expression to evaluate in case something happens.


Now if your database runs on a Mac and MBS FileMaker Plugin is installed, you can use the syntax coloring of our plugin to format the formula, e.g. like this script:

If [ MBS( "IsMacOS" ) = 1 ]
    Set Variable [ $r ; Value: MBS( "SyntaxColoring.Format"; EvaluateTest::Expression; 0 ) ]
    Set Field [ EvaluateTest::Expression ; $r ]
End If

The check For MacOS is to make sure we call it on MacOS and to check if the plugin is installed at all. If the plugin is missing, this will fail as a condition and then the format function is not called. The SyntaxColoring.Format function uses the syntax coloring definitions the plugin uses for formatting the expressions in the calculation dialog and you can change those. See fmSyntaxColorizer or other databases which provide an interface on the MBS Plugin function SyntaxColoring.AddTag to register those rules.

Check Error

To check for errors you may want to use EvaluationError on the result of Evaluate function. But in the expression you may want to have a Let wrapped in an If(false; ...) expression. The If makes sure the code will go through the parser for the syntax check, but not actually run. The Let with the expression makes sure we wrap your expression properly and you don't mess with the If. In case there are comments in the expression, the ¶ will block any // comment causing an error.

Here we test the If/Let evaluate combination:

Finally we put all in a script to run when expression field is saved and we put the error number into a field in our script:

Set Error Capture [ On ]
Set Variable [ $expression ; Value: "If(false; Let(r=" & EvaluateTest::Expression & "¶;0))" ]
Set Variable [ $e ; Value: EvaluationError(Evaluate($expression)) ]

Set Field [ EvaluateTest::Error ; $e ]

To get a list of the error codes possible, please check the list in the documentation in the 1200 to 1225 range.

Heise Mac Dev

Today at the Heise MacDev, a Mac & iOS developer conference organized by Heise publisher.

In the last ten years I visited Macoun a couple of times. Now we may end up having two conferences in Germany for Mac & iOS developers. Let's learn new techniques, meet local developers and get new contacts.

ImageMagick 7 for Xojo

In the last weeks we worked on a bigger project for our Xojo plugins. As you may know we support both GraphicsMagick and ImageMagick libraries in our plugin. For GraphicsMagick we build the library and embed it in our plugins. For ImageMagick we do not embed the library, so you need to bring your own library file. In our Xojo plugins we used to be based on version 6.9 of ImageMagick and we have three configurations: 8, 16 and 32 bit depth. We have each class for ImageMagick three times and by using one of the classes, you pick the depth you want, e.g. IMImageQ16MBS class for 16 bit. Then you need to load at runtime in your application the right library (DLL/dylib/so) and the classes can work.

For Image Magic 7 the API changes significantly. Half of the plugin code needed an update or rewrite. As we had to rewrite, we took a bigger approach. We created a new set of classes, all with 7 in the name. As ImageMagick now supports High Dynamic Range Images in the HDRI versions of the library, we got 7 combinations of 8, 16, 32, 64 bit with and without HDRI (There is no 64bit without HDRI). For a time we had all classes compiled in 7 versions, but this was not the designed we liked. How would it be to have one class which adapts?

After a few changes to the plugin code we got exactly this. You load the library and we run a few functions to ask the library whether it supports HDRI and what the desired depth is. In our functions to fill an image with a Xojo picture, we now branch out to the right code to convert a pixel from 8 bit in Xojo per channel into the desired bit depth. Yes, we have 7 functions in C code for this and use the right one.

You can simply download the current ImageMagick libraries from the website, e.g. ImageMagick-x86_64-apple-darwin19.0.0.tar.gz for MacOS or ImageMagick-7.0.9-7-Q16-HDRI-x64-dll.exe for Windows 64-bit. On Windows with installer just install it and the path environment variable points to the right folder, so you can just load the DLL by name. For MacOS, please point to the right dylib file. This works fine for us with 16 bit color depth on Mac and 16 bit HDRI on Windows.

Please try the new ImageMagick7 classes. ImageMagick is a huge library. We have already over 200 methods there to edit images with a lot of effects. But we are not yet done. But if you see a method you miss, please contact us.

Signature Field in FileMaker

Recently a customer asked for a signature field in FileMaker. As usual we replied with a note that this can be done with web viewer and a HTML 5 canvas control doing drawing. Then capture content with JavaScript and pass to FileMaker. The MBS FileMaker Plugin may help with WebView.RunJavaScript function. To transfer bigger blocks of text WebView.SetFormTextAreaValue and WebView.GetFormTextAreaValue can help with a hidden text area control. See video:

The script to save is quite easy as it just asks canvas to save its content as base64 encoded png image into the hidden text area. Then uses WebView.GetFormTextAreaValue to query this value, cuts out the header and decodes the base64 image:

Set Variable [ $r ; Value: MBS( "WebView.RunJavaScript" ; "web"; "formtest.output.value = document.getElementsByTagName('canvas')[0].toDataURL('image/png');" ) ]
Set Variable [ $dataURL ; Value: MBS( "WebView.GetFormTextAreaValue" ; "web"; "formtest"; "output"; 0 ) ]
Set Variable [ $p ; Value: Position($DataURL; ","; 1; 1) ]

If [ $p > 0 ]
    Set Variable [ $data ; Value: Middle($dataURL; $p + 1; Length($dataURL)) ]
    Set Field [ Signature Field::Data ; Base64Decode ( $data; "signature.png" ) ]
End If

We hope you like this example: We'll include it in future plugin releases as an example.

Black Friday and Cyber Monday sale

Our Black Friday & Cyber Monday sale continues till Tuesday evening:

First use coupon code BlackFridayMBS for our web shop to order new licenses with a 20% discount. Works for both FileMaker and Xojo plugin licenses.

If you have special needs, you can email us to get an invoice or Paypal payment link directly. We know some people need to wait till next week to order, so the offer is valid till Tuesday.

Second if you have purchased previously an individual MBS Xojo Plugin part from the Complete Set within the last two years, but not the whole set, we offer you an upgrade to the Complete set for the update price. Please consider to get the whole collection of 35 plugins instead of just one plugin.

See also Xojo Thanksgiving Sale and a for a collection of offers.

MBS FileMaker Plugin, version 9.6pr1

New in this prerelease of version 9.5 of the MBS FileMaker Plugin: Download at or ask for being added to the dropbox shared folder.

MBS Xojo Plugins, version 19.6pr1

New in this prerelease of the 19.6 plugins:
  • Added new ImageMagick 7.x classes. ImageMagick7MBS and related classes. Works with 8 to 64-bit quantum depth and HDRI support.
  • Updated SQLAPI to version 5.0.2.
  • Updated CURL library to version 7.67.0.
  • Added ThreadCount parameter for TransformLineStrideMT and TransformMT in LCMS2TransformMBS class.
  • Fixed issue with CubeSQL client in SQL Plugin to allow SHOW commands to work.
  • Added LMFitStatusMBS, LMFitControlMBS and LMFitMBS classes for Levenberg-Marquardt least squares fitting algorithm.
  • Added hasDate and hasTime properties to SQLDateTimeMBS class.
  • Fixed bug with random number generator on Windows not always working very randomly on threads. Affected UUIDMBS.randomUUID function used in threads.
  • Removed erroneous deprecation for ValidationMBS class.
  • Updated DynaPDF to version
  • Added LoadFileURL method for WKWebViewControlMBS class.
  • Fixed a few examples to compile for Xojo 2019r2.
  • Updated LibArchive to version 3.4.0.
  • Fixed crash with PDFViewControlMBS control in the Xojo IDE.
  • Improved code for ReadFile in SmartCardMBS to read in chunks of 256 bytes instead of 255 bytes.
  • Fixed crash in SubString() function in RegExMBS when called without an Execute first. Raising exceptions now in this case.
  • Changed graphics for DynaPDFMBS to not try to do transparency if you don't have Lite or higher license.
  • Optimized DynaPDF graphics support to not draw hidden vector objects.
  • Added HasLite and HasPro properties to DynaPDFMBS class.
  • Fixed reference counting problem in Commands() function in SQLDatabaseMBS and SQLConnectionMBS classes causing crashes.
  • Fixed problem in Readers function in SmartCardContextMBS class which may have cut off first character of a reader name.
  • Changed SetLineDashPattern event in DynaPDFParseInterfaceMBS class to pass double array instead of MemoryBlock and phase parameter as double.
  • Fixed crash in Commands functions in SQLDatabaseMBS and SQLConnectionMBS classes.
Or ask us to be added to our shared Dropbox folder.

Top Reasons for not getting an answer email from us

Customers send support requests, purchase licenses or use our web forms, but later some complain we never answered.
Please check if you may have met one of this conditions:
  • Check if you typed your email address correctly. Copy & Paste the email used and send a test email there. Maybe you missed a letter or swapped a few and don't see it yourself.
  • Check your spam folder for an answer. Sometimes our emails end up in spam folder.
  • Contact us with another email address. If your email server blocks us, we can't easily reach you. A second email address may be handy for us to contact you.
  • Check if you can white list our email address for your mail server.
  • Check if your mailbox on the server is not full. Moving a few emails in your mail app from inbox into a local archive folder may free up space on the server.
  • Send your email again after two days. Sometimes an email just gets lost.
It is sometimes scary how angry people can get if they don't get an answer in time. Sometimes we need to lookup a phone number and call clients to inform them their email is broken.
As usual, this just works fine for 99% of all emails.

Birthday of our video page

Over twelve years ago we started created tutorial videos and today our video page has birthday. Enjoy a video and learn about our plugins.

Over the years we collected more than 80 videos. We hope you enjoy them!

Watch Xojo Videos - FileMaker Videos

Youtube channels:

We know we could make more videos. So what wishes do you have?
Please email us or post a comment here.


Dec 2019
Nov 2019
Oct 2019
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