Skip to content

Instantly share code, notes, and snippets.

@roniemicro
Created September 4, 2014 09:40
Show Gist options
  • Select an option

  • Save roniemicro/8a1aa65f7750a0fe5997 to your computer and use it in GitHub Desktop.

Select an option

Save roniemicro/8a1aa65f7750a0fe5997 to your computer and use it in GitHub Desktop.
<?php
include "vendor/autoload.php";
$ID = 12345;
$str = <<<EOD
This is the body
Name : Roni
ID : {$ID}
---------------------
EOD;
$device = new \Epson\Devices\Network('192.168.1.250');
$printer = new \Epson\Printer($device);
$printer->setJustification(\Epson\EscPos::JUSTIFY_CENTER);
$printer->setEmphasis();
$printer->setUnderline(1);
$printer->setDoubleSize(true);
$printer->text("Header");
$printer->setDoubleSize(false);
$printer->setUnderline(0);
$printer->setJustification(\Epson\EscPos::JUSTIFY_LEFT);
$printer->setEmphasis(false);
$printer->text($str);
$printer->setBarcodeTextPosition(\Epson\EscPos::BARCODE_TXT_ABOVE);
$printer->barcode($ID);
//$printer->image('right.png');
$printer->cut();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment