Created
June 15, 2011 02:08
-
-
Save tensory/1026348 to your computer and use it in GitHub Desktop.
QR-code printing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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