Quirky TidBITS Issue Printing Problem Solved
It’s uncommon for people to want to print TidBITS issues, so I was surprised when Lauri Reinhardt, who helps us with support, forwarded me a message from a reader asking if there was a way to print the email issue of TidBITS with all the images. Neither of us had ever tried to do such a thing, but the reader was entirely correct: printing a TidBITS issue or exporting it to PDF resulted in blank boxes in place of the images.
Tinkering with Mail’s Protect Mail Activity setting made no difference, and the images showed up fine in the message itself—it wasn’t related to loading remote content. Even more confusing was the fact that Mimestream, which I use with Gmail, suffered from the same problem, but only in macOS 12 Monterey, not in macOS 13 Ventura. Printing from Gmail’s Web interface also worked fine.
A look at the raw source of our issues revealed a smoking gun right away: a
loading="lazy" attribute for every
IMG tag in articles. The sponsor banners at the top of the issue lacked that attribute, and they appeared in PDFs fine. Curious, I turned to Mimestream’s developer, Neil Jhaveri, who used to work on Mail at Apple. He said that Mail generates an offscreen web view, waits for the “load” part of the document to arrive, and then “prints.” But
loading="lazy" causes images to load only when scrolled into view, which never happens with printing. Mimestream shared the problem, at least in Monterey, because it uses WebKit for printing, just like Mail. Neil recommended dropping the
loading="lazy" attribute because he didn’t think images (at least those with
height attributes) would block the page from rendering until loaded anyway.
During these conversations, Lauri stumbled upon a workaround that makes sense in the context of Neil’s explanation. She postulated that perhaps the images were too large to load, so she tried shrinking them with the Scaling option in the Print dialog, which caused at least some images to display. I did testing and found that if I changed the scaling percentage to 99%, some images would load—but they’d be fuzzy—and others would remain blank. However, if I changed the scaling percentage more seriously, such as to 87%, and then scrolled through the entire document preview, all images would appear crisply in the resulting PDF, even if I later returned the scaling to 100%. Presumably, asking the Print dialog to scale the output forced WebKit to load all the images, allowing them to appear.
When I asked our developer Eli Van Zoeren to remove that
loading="lazy" attribute from the
IMG tags, he noted that WordPress inserted it automatically, so he added a filter to remove it from the email versions of our issues. (His code adds the sponsor banners to the issue separately, which is why they lack that attribute.) I was excited to test the fix with the next week’s issue, only to be disappointed to discover that the problem hadn’t gone away. It turned out that, after Eli filtered out
loading="lazy", WordPress replaced it with a similar-sounding attribute
decoding="async". After another round of Whack-an-Attribute, the problem disappeared for good.
So, while I don’t recommend printing TidBITS issues—we don’t format them for print, and they’ll consume quite a bit of paper—you’ll at least see the images now. Interestingly, both screenshots above have extra blank pages at the end. I don’t know why Mail adds them, but I recommend removing them. Choose File > Export to PDF, open the file in Preview, select the blank pages (and any other unnecessary pages) in the sidebar, and delete them before printing.
I very much doubt that many people were affected by this problem, but at least one TidBITS reader will be happier, and with luck, others who run into a similar problem will find this article and figure out how to solve it more quickly.
There is another problem with pictures. Since a while the RSS feed doesn’t show the pictures anymore.
What you described seems very similar to what I see when I use “print to PDF” to save some web references to my hard disk in PDF format to keep them for projects I am working on.
I have been experiencing this issue since late November. I find it affects just about everything I try to print as a PDF. It’s not just TidBits. It happens to me on laptop with Catalina, iMac on Monterey at work, and new M2 Air at home on Ventura. I find if I use a very old Safari Tech Preview for Catalina, it always produces the images correctly.
I’ve seen this for years in MacWorld, New York Times, Washington Post, etc., any long article I’ve wanted to save off and read when I’ve time.
It has fixed the issue of graphics in the Tidbits email newsletter as it appears on the Mail app on my laptops. Previously, for quite a while, only the first graphic would show after clicking the Load Content Directly button. I would have to click on each subsequent graphic to display that graphic in my browser.
I see pictures in my RSS feed. I use Reeder on an iPad with a NewsBlur account. I also see pictures when I use the NewsBlur web interface.
This article prompted memories of printing off emails to read later outside work in the early nineties. Devices were not so ubiquitous back then.
Although this issue deals with printing TidBITS from the email (Adam, thanks for fixing it!), it’s worth mentioning a similar problem of printing web pages with images missing that we discussed earlier. The solution I found most helpful was to use Print Friendly, either the browser extension or copy/paste the troublesome web page’s URL into the Print Friendly web page for printing. Print Friendly provides the added benefit of allowing you to selectively delete elements on the page before printing. I have started using it for those web pages where Safari’s Reader can’t produce a satisfactory result.
Firefox has another option for printing to PDF: selecting the Reader View (the little icon at the right end of the box showing the web address) as described in Print simplified, clutter-free pages in Firefox | Firefox Help
and then printing that cleaned-up page as a PDF. It’s an excellent way to clean up messy pages, which had slipped my mind until @Nalarider mentioned Print Friendly.
Yes, my thoughts too! It makes me wonder whether the scaling trick @lauri.reinhardt & @ace discovered might have solved @dredfearn’s printing issues in Safari too.
I just use Print Friendly now most of the time - it works fine and is easy to use.
I couildn’t get the pictures to show up in my mail programs, despite fussing with various settings. Now they appear. Whatever the cause, I’m glad to see images now instead of squares with a question mark.
Do you mean the TidBITS feed? It certainly includes the images, so I’m not sure why they couldn’t be appearing. I see them in my full-text member feed.
I see them. Both in my web browser (Firefox, via the Want My RSS extension) and via Feedly (web-based RSS reader)
Join the discussion in the TidBITS Discourse forum