Skip to content

Instantly share code, notes, and snippets.

@tensory
Created June 15, 2011 02:08
Show Gist options
  • Save tensory/1026348 to your computer and use it in GitHub Desktop.
Save tensory/1026348 to your computer and use it in GitHub Desktop.
QR-code printing
function printSticker($game, $url) {
global $StickersDir, $PrinterName;
$qrUrl = "https://chart.googleapis.com/chart?chs=300x300&cht=qr&choe=UTF-8&chl=".
urlencode($url);
system("curl '$qrUrl' > $StickersDir/qr.png");
$filename = $StickersDir . '/sticker_' . $game->game_id . '-' . $game->player . '.png';
system("composite ../assets/sticker_blank.png $StickersDir/qr.png $filename");
system("lpr -P $PrinterName $filename");
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment