Article Preview
Buy Now
COLUMN
I See Through You
Working With Transparent PDFs
Issue: 20.1 (January/February 2022)
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,587
Starting Page Number: 52
Article Number: 20106
Resource File(s):
project20106.zip Updated: 2022-01-02 19:45:08
Related Link(s): None
Excerpt of article text...
For a Christmas project I wanted to find an appropriate font. I started browsing through my thousands of fonts and discovered that's a challenging problem. Unless you actually install a font, MacOS doesn't give you much of a preview.
I thought: "I should use Xojo to make an app that would create a PDF of samples of all my fonts." As usual when I think of a personal project, I figured I'd write about it in
xDev and get an article out of it, too!Sadly, I could not get the
PDFDocument.addFonts
command to work for me. Even the code on Xojo's blog (https://blog.xojo.com/2020/08/27/xojos-pdfdocument-class-beyond-the-standard-14-and-more/
) didn't work. If Iinstalled the fonts, it worked, but the whole point ofaddFonts
is it is supposed to work without installation and there was no way I wanted to install 2,000+ fonts just to pickone for my project!So... today's column is going a different direction. I thought I'd explore PDFDocument's new ability to support transparency. This was added in 2021r3 and fills an important hole in Xojo's PDF support.
One of the keys of Xojo's PDF implementation is that it uses a clone of the
graphics
class, so any drawing you're already doing can easily be adapted to draw into a PDF instead. However, in the past, a significant limitation of this was that since PDFs didn't support transparency, what you got on the PDF often didn't match the screen.Hopefully, that is now rectified, though I suspect that there are still going to be enough differences that you can't just assume stuff will match and you'll still need to do extensive testing.
...End of Excerpt. Please purchase the magazine to read the full article.