2
0
forked from Wavyzz/dolibarr
Files
dolibarr-fork/htdocs/includes/mike42/escpos-php/example/graphics.php
Laurent Destailleur 9f20779136 Revert "Update escpos-php"
This reverts commit 2f42a226d0.
2016-05-18 13:18:55 +02:00

33 lines
833 B
PHP

<?php
/* Print-outs using the newer graphics print command */
require_once(dirname(__FILE__) . "/../Escpos.php");
$printer = new Escpos();
try {
$tux = new EscposImage("resources/tux.png");
$printer -> graphics($tux);
$printer -> text("Regular Tux.\n");
$printer -> feed();
$printer -> graphics($tux, Escpos::IMG_DOUBLE_WIDTH);
$printer -> text("Wide Tux.\n");
$printer -> feed();
$printer -> graphics($tux, Escpos::IMG_DOUBLE_HEIGHT);
$printer -> text("Tall Tux.\n");
$printer -> feed();
$printer -> graphics($tux, Escpos::IMG_DOUBLE_WIDTH | Escpos::IMG_DOUBLE_HEIGHT);
$printer -> text("Large Tux in correct proportion.\n");
$printer -> cut();
} catch(Exception $e) {
/* Images not supported on your PHP, or image file not found */
$printer -> text($e -> getMessage() . "\n");
}
$printer -> close();
?>