Skip to content

More New Features in Xojo PDF Support

The popular PDF support and features introduced last year in Xojo 2020r1, have gained several improvements and bug fixes in today’s release. Now, with Xojo 2021r1, Xojo’s PDF support include a set of new Graphics features that will continue to be expanded more in future releases.

First off, you can now use the CharacterSpacing property to adjust the text tracking:

Next, you can create outlined text in your PDF documents by setting the Outline property to True:

It is now possible to use the LineDash method and the LineDashOffset property on the rendered text in combination with lines, paths and other shapes likes ovals and rectangles. You can also use these in combination with the LineCap and LineJoin properties, like you can do with the regular Graphics class:

It’s even possible to use the SaveState and RestoreState methods in order to save and retrieve the graphics state values.

Check out the useful ClipToRectangle method in your PDF documents. With it, all the drawing (rasterization of text, paths and shapes) will be restricted to the inside of the rectangle designated as the clipping area:

And if you need symbolic glyphs, you’ll find that using the ZapfDingbats and Symbol fonts will be very helpful in order to keep full vectorial resolution at any size you may need:

Also important, is the new addition that lets you to create a PDF document composed of multiple page sizes, using NextPage (width As Integer, height As Integer):

Lastly, now it is possible to retrieve the full PDF data from the document as a MemoryBlock using the ToData method. This is very useful in cases where you don’t need to save the PDF document to a file in first place, like when you are displaying the PDF document in a web app.

Questions? Ask me on Twitter @XojoES or on the Xojo Forum.