You can't print this blog post
Update! It's fair to say no one liked this idea - so I've reverted it. Thanks for all the feedback 🙂
Do you ever see those daft email footers which say "Please consider the environment before printing this email." Like, who the fuck is still printing out their emails?
Anyway, a few years ago I went along to a blogging event where someone had printed out one of my blog posts. I was stunned. They'd stuck of loads of my posts (and other people's posts) on a mood board. Because I'm a digital fundamentalist, this pissed me off - what a waste of paper. Printing off a blog post is like making a radio broadcast of a sunset. Just pointless.
Luckily, there's a (very weak) form of DRM you can use to dissuade people from printing off your web pages:
CSS
@media print {
html { display: none; }
}
CSS has Media Rules for printing. You're supposed to use it to remove background images, menu bars, and other things which aren't useful. In this case, I've just told the browser not to display any content when it tries to print.
You can go a little further. This stops the page from rendering when printed, and adds a handy error message:
CSS
@media print{
body { display: none; }
html::after {
content: "Please consider the environment before printing this blog.";
}
}
I've tested this, and it works in Firefox, Safari, and Chrome. It's trivial to defeat this technical protection mechanism if you're handy with developer tools - but I guess those aren't the people who are printing off the entire Internet.
@edent says:
@media (print) { some-miniscule-layout-fixes-to-optimize-for-print }
and their users will get a good-enough archival format when they need it.Michael says:
Alcides Fonseca says:
@edent says:
@edent says:
@edent says:
Suw says:
@edent says:
Suw says:
Suw says: