Introducing the “Welcome to Xojo” Bundle!

New to Xojo and looking for guidance? We've put together a terrific bundle to welcome you! Xojo Bundle

This bundle includes six back issues of the magazine -- all of year 21 in printed book and digital formats -- plus a one-year subscription (beginning with 22.1) so you'll be learning all about Xojo for the next year. It's the perfect way to get started programming with Xojo. And you save as much as $35 over the non-bundle price!

This offer is only available for a limited time as supplies are limited, so hurry today and order this special bundle before the offer goes away!

Article Preview

Buy Now

Issue 19.3 ('Black Hole')
Instant purchase and download via GumRoad!


Drawing PDFs 2

New PDF Features in Xojo 2021r1

Issue: 19.3 (May/June 2021)
Author: Marc Zeedar
Author Bio: Marc taught himself programming in high school when he bought his first computer but had no money for software. He's had fun learning ever since.
Article Description: No description available.
Article Length (in bytes): 8,708
Starting Page Number: 76
Article Number: 19308
Resource File(s):

Download Icon project19308.zip Updated: 2021-05-02 22:26:13

Related Link(s): None

Excerpt of article text...

A few issues ago (in xDev 18.6) I wrote about Xojo's new PDF-creation feature. I'm glad to say they've been improving it and with 2021r1, it's gotten even better.

I had planned on writing about how it now works with rotation and scale, two exciting new additions to the graphics class, but after tearing my hair out trying to get it to work, I discovered the Xojo documentation is wrong in showing those features as being available for the PDFGraphics class. There's a Feedback case indicating such support is coming, but for now, ignore the docs—it doesn't work.

Still, there are improvements to PDFGraphics and they are cool. I'm not super-excited about stuff like the outline property, which lets you draw text in outline form (see Figure 1). The same goes for dashed-line support (see Figure 2). I suppose if you create PDF forms you might like dashed lines, but they're not something I can ever remember needing. There's nothing wrong with them, however, and they can be used for some interesting effects.

Saving State

Much more useful are the handy saveState and restoreState commands. These let you memorize the current graphics settings and restore them later. This will save you a lot of manual code.

For instance, haven't we all seen code like this:

...End of Excerpt. Please purchase the magazine to read the full article.