Replied to:
I full-heartedly agree with Jeremy: print stylesheets are one more feature of universal website design, and they go together rather well with QR codes …no matter how ugly, abused and underused they are.
There luckily is an alternative to Google’s Chart API (whose shutdown had been announced for 2015 last time I checked; that’s three years in the past). In true Indieweb manner, QR codes can be self-generated locally using the open source PHP library PHP QR Code. Its latest version is eight years old, but it still works like a charm - check out the print preview of this post for a proof of concept.
Here’s the piece of code I use with above library to generate mine, before caching them on the server for output:
<?php
if ( isset( $_REQUEST['url'] ) && trim( $_REQUEST['url'] ) != '' ) {
include "qrlib.php";
// a writable location, where the temp PNG files are stored
$tempdir = dirname(__FILE__) . DIRECTORY_SEPARATOR . 'temp' . DIRECTORY_SEPARATOR;
if (!file_exists($tempdir))
mkdir($tempdir);
// sanitize URL
$url = filter_var(urldecode( $_REQUEST['url'] ), FILTER_SANITIZE_URL);
// set error correction and code size
$errcorr = 'L'; // L (low, smallest QR code) -> M -> Q -> H (highest error correction, bigger QR code)
$size = 3; // width/height per "QR pixel" in pixels
// create QR code and store PNG in temp dir
$filename = $tempdir . md5($url .'|' . $errcorr . '|' . $size) . '.png';
QRcode::png($url, $filename, $errcorr, $size, 2);
// open PNG file in binary mode
$file = fopen($filename, 'rb');
// send the right headers
header("Content-Type: image/png");
header("Content-Length: " . filesize($filename));
// dump the picture
fpassthru($file);
}
?>
Jeremy, maybe this allows you to prepare your talk free from any fear over a long-declared-dead Google API going away? The library even allows for SVG output, which might be neat for presentation slides - for web print styles I believe PNG to be the format with less inconsistencies.