Article Preview
Buy Now
COLUMN
Rotating PDFs Part 1
Finally we can rotate and scale. Maybe.
Issue: 19.5 (September/October 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): 7,886
Starting Page Number: 82
Article Number: 19507
Resource File(s):
project19507.zip Updated: 2021-08-31 23:29:16
Related Link(s): None
Excerpt of article text...
I recently wrote some articles about Xojo's new PDF features (see
xDev 18.6 and 19.3), but two key additions—therotation
andscale
commands of thegraphics
class—were missing in action. They worked for pictures, but not for thePDFGraphics
class (despite it being a subset ofgraphics
).Finally, with the release of Xojo 2021R2.1, that problem has been solved.
Or has it? While the features are now implemented, the implementation leaves some questions as to how useful they will be.
Let's Rotate
In theory, using the rotate command is easy. Just add a line like
g.rotate(10)
to your code (whereg
is agraphics
orPDFGraphics
object). As always, though, it's not as simple as it looks.First, rotation happens in
radians , not degrees. (Why? I don't know. I'm not a math person and stuff like this just bewilders me. My whole education has taught me to think in degrees.)
...End of Excerpt. Please purchase the magazine to read the full article.