Xojo 2020r1

  • Xojo 2020r1 Now Available For Download; Adds New Web Framework, PDF Support Xojo 2020 Release 1 is now available for download! With 347 changes and improvements, this release adds the highly anticipated new web framework, which is a ground-up rewrite that adds great looking new controls, automatic session restoring and automatic reconnection.
  • 2020r1 I’d originally written this post in May thinking that “Surely Xojo MUST be done by now” and that I could write a quick review post after Xojo released R1 “any time now”. I wrote that originally on May 11.
  1. Xojo 2020 1080p
  2. Xojo 2020 18
  3. Xojo 2020 123
  4. Xojo 2020
  5. Xojo 2020 10

Xojo 2020r1 available Today Xojo Inc. Released the new version of Xojo 2020r1. It brings a lot of new features like Web 2.x, PDFDocument and more. With Web 2.0 Xojo Inc. Navigated itself in a corner as they promised 2020r1 to ship with Web 2, but that was not ready in spring for a release. 2020r1.1 Release Notes From Xojo Documentation (September 28, 2020) This release has important improvements to Xojo 2020r1. Download Xojo today.

From Xojo Documentation

(September 28, 2020)

This release has important improvements to Xojo 2020r1.

Download Xojo today.

  • 1Release Notes

Release Notes

Bug Fixes (44 cases)

61797WebTimers created in code work again.
61613Crashes & Assertions » Failed AssertionWindows: Loading URLs before the WebKit based HTMLViewer was initialized potentially caused failed assertions in REALstring.cpp because code was not being safely executed in the main UI thread, but now it is.
61272Framework » AllServerSocket: remove unused SocketRequested event.
61384Framework » AllFixed an assertion in REALstring.cpp that could occur when converting a string from one encoding to another depending on what active thread is doing the conversion.
61636Framework » AllBoolean values are now returned correctly when Iterating rows in a RowSet.
61805Framework » AllDouble.IsNotANumber was incorrectly implemented as Double.IsInfinite and vice versa, this is now fixed.
61370Framework » WebWebSegmentedControl.Pressed event now fires on every click when SelectionStyle = None.
61395Framework » WebWebToolbar buttons and titles which contain elements that are html encoded now render properly at runtime.
61430Framework » WebWebCheckbox caption is now correctly encoded.
61476Framework » WebFixed a potential NilObjectException when calling WebDialog.Close.
61486Framework » WebWebPage.Title is now property encoded.
61489Framework » WebWebViews whose display type is set to Flex now obey the value of their Visible property.
61496Framework » WebWebButton indicator colors can be set back to Default at runtime again.
61497Framework » WebUpdateBrowser sends control changes to the browser immediately again.
61509Framework » WebWebTextField.LostFocus events now fire if the control is last in the tab order.
61531Framework » WebStyle values which are empty or end with a semicolon no longer cause javascript errors at runtime.
61565Framework » WebWebTextField (and subclasses thereof) properly encode text again.
61576Framework » WebWebSDKControl.BrowserCompatibility no longer breaks into a blank debugger window if the requested item doesn't exist.
61583Framework » WebWebToolbarItems of type Menu no longer have two icons and they are now the correct size.
61589Framework » WebWeb apps no longer completely lock up in TCPSocket.Flush when the CPU is otherwise starved by a tight loop.
61608Framework » WebSetting a WebSegmentedButton's title to an empty string works now.
61622Framework » WebWebListbox.LastAddedRowIndex is now correct after calling AddRowAt.
61624Framework » WebWebListbox.CellValueAt now pulls from the correct row after rows have been inserted before the selected row.
61625Framework » WebWeblistbox rows are now added in the correct order.
61629Framework » WebRows inserted with WebListbox.AddRowAt are now added at the correct location in the backing data.
61632Framework » WebWebMenuItems.Icons are now WebPictures instead of just plain Pictures.
61654Framework » WebFixed a bug which caused WebListbox.SelectedRowIndex to be relative to the most recently loaded block of data instead of the entire list of items.
61662Framework » WebWebSDK controls no longer send the same JavaScript and CSS files to the same browser multiple times.
61668Framework » WebWebSegmentedButton titles can now be set in code.
61685Framework » WebWebDialog.Dismissed is no longer when it was never shown.
61688Framework » WebWebListbox headers set at runtime are no longer invisible.
61704Framework » WebCalling MessageBox in a Web project with an empty string no longer raises an OutOfBoundsException.
61728Framework » WebSetting the value of a WebTextField at runtime no longer HTML-encodes the value.
61732Framework » WebThe WebComboBox value when the control is first created is correct again.
61746Framework » WebHaving HandleURL implemented, and not returning True or setting the status to something other than 404 when the URL passed in is an empty string no longer raises an OutOfBoundsException in App.UnhandledException.
61784Framework » WebWebTextFields of type Telephone now show the correct keyboard on iOS.
61786Framework » WebWebComboBox.RemoveAllRows works now.
61794Framework » WebWebTimer.Enabled now works for WebTimers whose Location is set to Server.
61804Framework » WindowsURLConnection: populated request error exception's ErrorNumber with a more meaningful value.
61752Framework » macOSHTMLViewer: floating-point values received by a Javascript request (via executeInXojo) no longer truncates the fractional part.
61796IDE » Language ReferenceLinux IDE: using the Local Language Reference no longer strictly requires libwebkitgtk-3 to be installed.
61618IDE » Layout EditorThe default event for WebDatePicker is now set to ValueChanged.
61407IDE » UpdaterPrerelease update dialog now takes users to the correct place on the new forum.
61484IDE » Web 2.0 Project ConverterWhen converting binary or xml web 1.0 projects, the initial value of PopupMenus are now retained.

Changes (6 cases)

61463Framework » WebWebSearchField.ValueChanged now fires whenever the text changes. The new Pressed event fires when the user presses the Enter/Return key or clicks the search or cancel buttons.
61478Framework » WebWebSessionContexts now throw an UnsupportedOperationException if you try to create one within another Session.
61491Framework » WebWebToolbarItems with icons now disable the icons when the item itself is disabled.
61584Framework » WebThe deprecated WebFile.OnDownloaded delegate has been removed.
61778Framework » WebThe UpdateBrowser methods on WebSDKControl and WebSDKUIControl have been deprecated and replaced with UpdateControl(sendImmediately as Boolean = False) to cut down on unnecessary traffic when multiple things change in an SDK control.
61473Framework » macOSAdded a patch in System.Version so macOS 10.16 will be reported as 11.0 even on apps running under rosetta 2.

New Items (6 cases)

60101Framework » WebWebLabel now has a Pressed event.
61502Framework » WebWebToolbarItem now has a Visible property.
61503Framework » WebWebToolbar now has an ItemWithTag method to make it easier to modify its contents at runtime.
61573Framework » WebWebSession now has ClientWidth and ClientHeight properties which are populated before the session Opening event fires so better decisions can be made about which layouts to use. Both of these values are updates when the WebSession.Resized and WebSession.OrientationChanged events fire.
61644Framework » WebAdded WebListBoxRowData.Tag property and updated RowTagAt to allow retrieving this data at runtime.
61646Framework » WebWebImageViewer and WebCanvas now have a Pressed event which pass the X and Y coordinate of where the user clicked or touched the control.

Docs and Examples (8 cases)

61516ExamplesUpdated SQLiteExample to make better use of API 2.0.
61588ExamplesUpdated WebSimpleSendEmail example for Web 2.0.
61312Language Reference » DocumentationThe DeleteEntireFolder example in the FolderItem.Remove page of the Language Reference has been updated to API 2.0.
61447Language Reference » DocumentationThe example code for WebSessionContext now uses an iterator instead.
61459Language Reference » DocumentationThe WebFileUploader.UploadError event now is properly documented to reflect that a RuntimeException is passed to it rather than a status code and message.
61564Language Reference » DocumentationUpdated code in WebApplication.HandleURL Notes to use Web 2.0 commands.
61591Language Reference » DocumentationWebListBoxRowData has been documented.
61708Language Reference » DocumentationListBox.AllColumns and ListBox.AllRows are now documented both on the ListBox page and on various methods where they can be used.
Xojo 2020 18
Retrieved from 'http://docs.xojo.com/index.php?title=Resources:2020r1.1_Release_Notes&oldid=76993'

Xojo 2020r1 brings a highly requested feature to the Xojo IDE: the ability to create PDF documents from code! Now you can use the already familiar methods in Xojo’s Graphics class to create Standard PDF 1.4 documents with the PDFDocument class.

This is the first iteration of the PDFDocument class and we are very aware of the things that we will be adding in future releases that are not in 2020r1. Nevertheless, this first set of features will let you create many of the documents you need in Desktop, Web and Console.

In addition, you’ll be glad to know that both the text and the geometric forms you add to your PDF documents are vectorial! Except those generated when “printing” PDF documents from your Reports; those will be vectorial once we add Obejct2D support to the PDFDocument class.

The fact that both text and geometric forms are vectorial in your PDF documents means that these will be rendered with 100% quality, independently the scale factor you (or your users) may be using once they display them with any PDF viewer utility or App.

In addition, because the text is vectorial it will be searchable using any PDF utility with text search capabilities; and, for example, when using the Preview app on macOS, the data detector’s technology will be able to catch and act on some specific data like telephone numbers or postal addresses.

Creating a PDF Document

Xojo 2020 1080p

As when using any other class from the Xojo framework, start by creating a new instance for the PDF document. So, in this case you only need to use:

Xojo 2020 18

It will use the by default constructor, creating a document with a letter size blank page.

If you want to specify a concrete page size, you may use any of the included Enumeration values, for example:

Or any other arbitrary size:

So, in this case, the PDF document will be created with a 500 width x 500 height pixels for the page.

Drawing into the PDF Document Page

You’ll be able to include text, Pictures and some geometric forms like Lines, Circles/Ovals, Rectangles/Rounded Rectangles (both in their filled or outline variants). For that you can use the same methods and properties you use when drawing over any regular Graphics context.

For example, the following code snippet will draw a filled circle centered on the PDF page:

While the next one will draw the “Hello PDF World” text centered on the page and over the previously drawn circle.

Adding New Pages to the PDF Document

In order to add a new page to your PDF document you only need to call the NextPage method on its graphic context:


And that means that, from now on, all the drawing commands will be made on the new page. For example, let’s use some large fragment of text so it will be centred on the new Page (this one will be the classic “Lorem Ipsum” text, stored in this case by the kLoremIpsum Constant):

At this point, our PDF document will be as the one displayed in the following screenshot:

Adding Pictures

Let’s say we did add the “Trees” Picture to our Xojo project. We will be able to draw it on the desired coordinates (and with the desired size of 50 x 50 pixels) over the PDF document page using the following sentences:


You can set the usual metadata to the PDF documents using Xojo. For example:

Once you save the document to disk, this information will be available (and displayed) as part of the PDF properties- for example, using the Preview app on macOS:

Saving a PDF Document to Disk

In order to save the PDF documents created with Xojo to disk, you’ll need a valid FolderItem instance. Next call the Save method on the PDF document instance and give to it the FolderItem instance as the parameter. For example:

In this case, the last line of code will open the PDF document using the default app or utility set on your OS.

Xojo 2020 123

Included PDF Examples

Xojo 2020

These are just some of the basics when creating and working with PDF Documents in Xojo, and I encourage you to explore the PDF project examples you’ll find inside the Example Projects > PDF folder. For example, there you can find how to create PDF documents that look the same both when using a regular Graphics context and the PDFDocument instance, including composing documents with data retrieved from a database or any dynamic data source, both in Desktop and Web.

Xojo 2020 10

In addition, you can find how to create PDF documents with more complex layouts, combining text, geometric figures and pictures, or even creating a basic graphic chart using rectangles.

Coming Next!

We are well aware of all the possibilities offered by the PDF standard! Future features coming to the PDFDocument class include support for Object2D, full Unicode text support, hyperlinks, document ciphering, and much more! We also intend to support PDFDocument with iOS in the future.