-
Notifications
You must be signed in to change notification settings - Fork 862
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
33 changed files
with
1,289 additions
and
183 deletions.
There are no files selected for viewing
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
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
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
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
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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
<?php | ||
require __DIR__ . '/../../autoload.php'; | ||
use Mike42\Escpos\Printer; | ||
use Mike42\Escpos\PrintConnectors\FilePrintConnector; | ||
|
||
$a = "{A012323392982"; | ||
$b = "{B012323392982"; | ||
$c = "{C" . chr(01) . chr(23) . chr(23) . chr(39) . chr(29) . chr(82); | ||
|
||
$connector = new FilePrintConnector("php://stdout"); | ||
$printer = new Printer($connector); | ||
$printer -> setJustification(Printer::JUSTIFY_CENTER); | ||
$printer -> setBarcodeHeight(48); | ||
$printer->setBarcodeTextPosition(Printer::BARCODE_TEXT_BELOW); | ||
foreach(array($a, $b, $c) as $item) { | ||
$printer -> barcode($item, Printer::BARCODE_CODE128); | ||
$printer -> feed(1); | ||
} | ||
$printer -> cut(); | ||
$printer -> close(); | ||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
<?php | ||
require __DIR__ . '/../../autoload.php'; | ||
use Mike42\Escpos\Printer; | ||
use Mike42\Escpos\PrintConnectors\FilePrintConnector; | ||
use Mike42\Escpos\CapabilityProfiles\DefaultCapabilityProfile; | ||
|
||
$connector = new FilePrintConnector("php://stdout"); | ||
$profile = DefaultCapabilityProfile::getInstance(); | ||
$printer = new Printer($connector, $profile); | ||
|
||
$printer -> text("Μιχάλης Νίκος\n"); | ||
$printer -> cut(); | ||
$printer -> close(); | ||
|
||
?> |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
<?php | ||
/* | ||
* Example of dithering used in EscposImage by default, if you have Imagick loaded. | ||
*/ | ||
require __DIR__ . '/../../autoload.php'; | ||
use Mike42\Escpos\Printer; | ||
use Mike42\Escpos\EscposImage; | ||
use Mike42\Escpos\PrintConnectors\FilePrintConnector; | ||
|
||
$connector = new FilePrintConnector("/dev/usb/lp0"); | ||
$printer = new Printer($connector); | ||
try { | ||
/* Load with optimisations enabled. If you have Imagick, this will get you | ||
a nicely dithered image, which prints very quickly | ||
*/ | ||
$img1 = EscposImage::load(__DIR__ . '/../resources/tulips.png'); | ||
$printer -> bitImage($img1); | ||
|
||
/* Load with optimisations disabled, forcing the use of PHP to convert the | ||
pixels, which uses a threshold and is much slower. | ||
*/ | ||
$img2 = EscposImage::load(__DIR__ . '/../resources/tulips.png', false); | ||
$printer -> bitImage($img2); | ||
$printer -> cut(); | ||
} finally { | ||
/* Always close the printer! */ | ||
$printer -> close(); | ||
} |
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
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
Oops, something went wrong.