Article Preview
Buy Now
COLUMN
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):
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 withrotation
andscale
, two exciting new additions to thegraphics
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 thePDFGraphics
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 toPDFGraphics
and they are cool. I'm not super-excited about stuff like theoutline
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
andrestoreState
commands. These let you memorize the currentgraphics
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.