Skip to content

Commit

Permalink
Merge pull request #700 from mike42/development
Browse files Browse the repository at this point in the history
Changes for release 2.1
  • Loading branch information
mike42 authored Feb 17, 2019
2 parents 416e340 + 5e904fe commit 10b1230
Show file tree
Hide file tree
Showing 34 changed files with 242 additions and 91 deletions.
22 changes: 15 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,11 +67,13 @@ This driver is known to work with the following OS/interface combinations:
### Printers
Many thermal receipt printers support ESC/POS to some degree. This driver has been known to work with:

- 3nStrat POS-08
- 3nStar RPT-008
- Approx APPPOS80AM
- AURES ODP-333
- AURES ODP-500
- Bematech-4200-TH
- Bematech LR2000E
- Birch PRP-085III
- Bixolon SRP-350III
- Black Copper BC-85AC
- Citizen CBM1000-II
Expand Down Expand Up @@ -99,23 +101,29 @@ Many thermal receipt printers support ESC/POS to some degree. This driver has be
- Excelvan HOP-E200
- Excelvan HOP-E58
- Excelvan HOP-E801
- Excelvan ZJ-8220
- Gainscha GP-5890x (Also marketed as EC Line 5890x)
- Gainscha GP-U80300I (Also marketed as gprinter GP-U80300I)
- gprinter GP-U80160I
- HOIN HOP-H58
- Ithaca iTherm 28
- Hasar HTP 250
- Metapace T-1
- Metapace T-25
- Nexa PX700
- Nyear NP100
- Okipos 80 Plus III
- OKI RT322
- OKI 80 Plus III
- Orient BTP-R580
- Partner Tech RP320
- P-822D
- P85A-401 (make unknown)
- Partner Tech RP320
- POSLIGNE ODP200H-III-G
- QPOS Q58M
- Rongta RP326US
- Rongta RP58-U
- Rongta RP80USE
- Senor TP-100
- Sewoo SLK-TS400
- SEYPOS PRP-300 (Also marketed as TYSSO PRP-300)
- Sicar POS-80
- Silicon SP-201 / RP80USE
Expand All @@ -126,6 +134,7 @@ Many thermal receipt printers support ESC/POS to some degree. This driver has be
- Star TSP-650
- Star TUP-592
- Venus V248T
- Xeumior SM-8330
- Xprinter F-900
- Xprinter XP-365B
- Xprinter XP-58 Series
Expand All @@ -135,9 +144,8 @@ Many thermal receipt printers support ESC/POS to some degree. This driver has be
- Xprinter XP-Q800
- Zjiang NT-58H
- Zjiang ZJ-5870
- Zjiang ZJ-5890K
- Zjiang ZJ-5890T (Marketed as POS 5890T)
- Zjiang ZJ-8220
- Zjiang ZJ-5890 (Also sold as POS-5890 by many vendors; ZJ-5890K, ZJ-5890T also work).
- Zjiang ZJ-8220 (Also marketed as Excelvan ZJ-8220)

If you use any other printer with this code, please [let us know](https://github.com/mike42/escpos-php/issues/new) so that it can be added to the list.

Expand Down
4 changes: 2 additions & 2 deletions example/character-encodings-with-images.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
require __DIR__ . '/../autoload.php';
use Mike42\Escpos\Printer;
use Mike42\Escpos\PrintConnectors\FilePrintConnector;
use Mike42\Escpos\CapabilityProfiles\DefaultCapabilityProfile;
use Mike42\Escpos\PrintBuffers\EscposPrintBuffer;
use Mike42\Escpos\PrintBuffers\ImagePrintBuffer;
use Mike42\Escpos\CapabilityProfile;

/**
* This example builds on character-encodings.php, also providing an image-based rendering.
Expand All @@ -21,7 +21,7 @@
try {
// Enter connector and capability profile
$connector = new FilePrintConnector("php://stdout");
$profile = DefaultCapabilityProfile::getInstance();
$profile = CapabilityProfile::load('default');
$buffers = array(new EscposPrintBuffer(), new ImagePrintBuffer());

/* Print a series of receipts containing i18n example strings */
Expand Down
4 changes: 2 additions & 2 deletions example/character-encodings.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
require __DIR__ . '/../autoload.php';
use Mike42\Escpos\Printer;
use Mike42\Escpos\PrintConnectors\FilePrintConnector;
use Mike42\Escpos\CapabilityProfiles\DefaultCapabilityProfile;
use Mike42\Escpos\CapabilityProfile;

/**
* This demonstrates available character encodings. Escpos-php accepts UTF-8,
Expand All @@ -27,7 +27,7 @@
try {
// Enter connector and capability profile (to match your printer)
$connector = new FilePrintConnector("php://stdout");
$profile = DefaultCapabilityProfile::getInstance();
$profile = CapabilityProfile::load("default");

/* Print a series of receipts containing i18n example strings */
$printer = new Printer($connector, $profile);
Expand Down
4 changes: 2 additions & 2 deletions example/character-tables.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@
require __DIR__ . '/../autoload.php';
use Mike42\Escpos\Printer;
use Mike42\Escpos\PrintConnectors\FilePrintConnector;
use Mike42\Escpos\CapabilityProfiles\DefaultCapabilityProfile;
use Mike42\Escpos\CapabilityProfile;

// Enter connector and capability profile (to match your printer)
$connector = new FilePrintConnector("php://stdout");
$profile = DefaultCapabilityProfile::getInstance();
$profile = CapabilityProfile::load("default");
$verbose = false; // Skip tables which iconv wont convert to (ie, only print characters available with UTF-8 input)

/* Print a series of receipts containing i18n example strings - Code below shouldn't need changing */
Expand Down
4 changes: 2 additions & 2 deletions example/specific/32-german-tm-t20-ii-custom-command.php
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<?php
require __DIR__ . '/../../autoload.php';
use Mike42\Escpos\CapabilityProfile;
use Mike42\Escpos\Printer;
use Mike42\Escpos\PrintConnectors\FilePrintConnector;
use Mike42\Escpos\CapabilityProfiles\DefaultCapabilityProfile;

/*
* This example shows how tok send a custom command to the printer-
Expand All @@ -22,7 +22,7 @@

/* Set up profile & connector */
$connector = new FilePrintConnector("php://output");
$profile = DefaultCapabilityProfile::getInstance(); // Works for Epson printers
$profile = CapabilityProfile::load("default"); // Works for Epson printers

$printer = new Printer($connector, $profile);
$cmd = Printer::ESC . "V" . chr(1); // Try out 90-degree rotation.
Expand Down
4 changes: 2 additions & 2 deletions example/specific/33-spanish-seypos-prp-300.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@
* Use the hardware switch to activate "Two-byte Character Code"
*/
require __DIR__ . '/../../autoload.php';
use Mike42\Escpos\CapabilityProfile;
use Mike42\Escpos\Printer;
use Mike42\Escpos\PrintConnectors\FilePrintConnector;
use Mike42\Escpos\CapabilityProfiles\SimpleCapabilityProfile;

$connector = new FilePrintConnector("php://output");
$profile = SimpleCapabilityProfile::getInstance();
$profile = CapabilityProfile::load("simple"); // Works for Epson printers
$printer = new Printer($connector);
$printer -> text("El pingüino Wenceslao hizo kilómetros bajo exhaustiva lluvia y frío, añoraba a su querido cachorro.\n");
$printer -> cut();
Expand Down
4 changes: 2 additions & 2 deletions example/specific/37-chinese.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@
* can be properly detected and printed alongside other encodings.
*/
require __DIR__ . '/../../autoload.php';
use Mike42\Escpos\CapabilityProfile;
use Mike42\Escpos\Printer;
use Mike42\Escpos\PrintConnectors\FilePrintConnector;
use Mike42\Escpos\CapabilityProfiles\SimpleCapabilityProfile;

$connector = new FilePrintConnector("/dev/usb/lp1");
$profile = SimpleCapabilityProfile::getInstance();
$profile = CapabilityProfile::load("default");

$printer = new Printer($connector);

Expand Down
7 changes: 3 additions & 4 deletions example/specific/39-currency-symbols.php
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
<?php
require __DIR__ . '/../../autoload.php';
use Mike42\Escpos\CapabilityProfile;
use Mike42\Escpos\Printer;
use Mike42\Escpos\PrintConnectors\FilePrintConnector;
use Mike42\Escpos\PrintBuffers\ImagePrintBuffer;
use Mike42\Escpos\CapabilityProfiles\DefaultCapabilityProfile;
use Mike42\Escpos\CapabilityProfiles\SimpleCapabilityProfile;

$profile = DefaultCapabilityProfile::getInstance();
$profile = CapabilityProfile::load("default");
// This is a quick demo of currency symbol issues in #39.

/* Option 1: Native ESC/POS characters, depends on printer and is buggy. */
Expand Down Expand Up @@ -40,7 +39,7 @@
are not available in CP437. CP858 has good printer support, but is not
included in all iconv builds.
*/
class CustomCapabilityProfile extends SimpleCapabilityProfile
class CustomCapabilityProfile extends CapabilityProfile
{
function getCustomCodePages()
{
Expand Down
4 changes: 2 additions & 2 deletions example/specific/44-pound-symbol-star-tsp650.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,14 @@

// Adjust these to your environment
require __DIR__ . '/../../autoload.php';
use Mike42\Escpos\CapabilityProfile;
use Mike42\Escpos\Printer;
use Mike42\Escpos\PrintConnectors\FilePrintConnector;
use Mike42\Escpos\CapabilityProfiles\SimpleCapabilityProfile;

$connector = new FilePrintConnector("php://stdout");

// Start printer
$profile = SimpleCapabilityProfile::getInstance();
$profile = CapabilityProfile::load("simple");
$printer = new Printer($connector, $profile);

// A) Raw pound symbol
Expand Down
4 changes: 2 additions & 2 deletions example/specific/50-P-822D-greek.php
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
<?php
/* Example of Greek text on the P-822D */
require __DIR__ . '/../../autoload.php';
use Mike42\Escpos\CapabilityProfile;
use Mike42\Escpos\Printer;
use Mike42\Escpos\CapabilityProfiles\P822DCapabilityProfile;
use Mike42\Escpos\PrintConnectors\FilePrintConnector;

// Setup the printer
$connector = new FilePrintConnector("php://stdout");
$profile = P822DCapabilityProfile::getInstance();
$profile = CapabilityProfile::load("P822D");
$printer = new Printer($connector, $profile);

// Print a Greek pangram
Expand Down
6 changes: 3 additions & 3 deletions example/specific/54-gfx-sidebyside.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@
* object into some sort of cache if you will re-use the output.
*/
require __DIR__ . '/../../autoload.php';
use Mike42\Escpos\CapabilityProfile;
use Mike42\Escpos\Printer;
use Mike42\Escpos\EscposImage;
use Mike42\Escpos\CapabilityProfiles\DefaultCapabilityProfile;
use Mike42\Escpos\PrintConnectors\FilePrintConnector;

// Paths to images to combine
Expand All @@ -38,11 +38,11 @@
// Detect and handle command failure
throw new Exception("Command \"$cmd\" returned $retval." . implode("\n", $outp));
}
$img = new EscposImage($imgCombined_path);
$img = EscposImage::load($imgCombined_path);

// Setup the printer
$connector = new FilePrintConnector("php://stdout");
$profile = DefaultCapabilityProfile::getInstance();
$profile = CapabilityProfile::load("default");

// Run the actual print
$printer = new Printer($connector, $profile);
Expand Down
4 changes: 2 additions & 2 deletions example/specific/6-arabic-epos-tep-220m.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@
* handling the layout for this example.
*/
require __DIR__ . '/../../autoload.php';
use Mike42\Escpos\CapabilityProfile;
use Mike42\Escpos\Printer;
use Mike42\Escpos\PrintConnectors\FilePrintConnector;
use Mike42\Escpos\PrintBuffers\ImagePrintBuffer;
use Mike42\Escpos\CapabilityProfiles\EposTepCapabilityProfile;

/*
* Drop Ar-php into the folder listed below:
Expand Down Expand Up @@ -55,7 +55,7 @@
$buffer -> setFont($fontPath);
$buffer -> setFontSize($fontSize);

$profile = EposTepCapabilityProfile::getInstance();
$profile = CapabilityProfile::load("TEP-200M");
$connector = new FilePrintConnector("php://output");
// = new WindowsPrintConnector("LPT2");
// Windows LPT2 was used in the bug tracker
Expand Down
4 changes: 2 additions & 2 deletions example/specific/62-greek-symbol-swap.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
require __DIR__ . '/../../autoload.php';
use Mike42\Escpos\Printer;
use Mike42\Escpos\PrintConnectors\FilePrintConnector;
use Mike42\Escpos\CapabilityProfiles\DefaultCapabilityProfile;
use Mike42\Escpos\CapabilityProfile;

$connector = new FilePrintConnector("php://stdout");
$profile = DefaultCapabilityProfile::getInstance();
$profile = CapabilityProfile::load("default");
$printer = new Printer($connector, $profile);

$printer -> text("Μιχάλης Νίκος\n");
Expand Down
4 changes: 2 additions & 2 deletions example/specific/68-redblack.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@
$printer = new Printer($connector);
try {
$printer -> text("Hello World!\n");
$printer -> setColor(Escpos::COLOR_2);
$printer -> setColor(Printer::COLOR_2);
$printer -> text("Red?!\n");
$printer -> setColor(Escpos::COLOR_1);
$printer -> setColor(Printer::COLOR_1);
$printer -> text("Default color again?!\n");
$printer -> cut();
} finally {
Expand Down
6 changes: 3 additions & 3 deletions src/Mike42/Escpos/CapabilityProfile.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@
* This file is part of escpos-php: PHP receipt printer library for use with
* ESC/POS-compatible thermal and impact printers.
*
* Copyright (c) 2014-16 Michael Billington < [email protected] >,
* Copyright (c) 2014-18 Michael Billington < [email protected] >,
* incorporating modifications by others. See CONTRIBUTORS.md for a full list.
*
* This software is distributed under the terms of the MIT license. See LICENSE.md
* for details.
*/

namespace Mike42\Escpos;

use Mike42\Escpos\CodePage;
use \InvalidArgumentException;

/**
Expand Down Expand Up @@ -108,7 +108,7 @@ class CapabilityProfile
* Construct new CapabilityProfile.
* The encoding data must be loaded from disk before calling.
*
* @param unknown $profileId
* @param string $profileId
* ID of the profile
* @param array $profileData
* Profile data from disk.
Expand Down
3 changes: 2 additions & 1 deletion src/Mike42/Escpos/CodePage.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,13 @@
* This file is part of escpos-php: PHP receipt printer library for use with
* ESC/POS-compatible thermal and impact printers.
*
* Copyright (c) 2014-16 Michael Billington < [email protected] >,
* Copyright (c) 2014-18 Michael Billington < [email protected] >,
* incorporating modifications by others. See CONTRIBUTORS.md for a full list.
*
* This software is distributed under the terms of the MIT license. See LICENSE.md
* for details.
*/

namespace Mike42\Escpos;

use \InvalidArgumentException;
Expand Down
11 changes: 11 additions & 0 deletions src/Mike42/Escpos/Devices/AuresCustomerDisplay.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,15 @@
<?php
/**
* This file is part of escpos-php: PHP receipt printer library for use with
* ESC/POS-compatible thermal and impact printers.
*
* Copyright (c) 2014-18 Michael Billington < [email protected] >,
* incorporating modifications by others. See CONTRIBUTORS.md for a full list.
*
* This software is distributed under the terms of the MIT license. See LICENSE.md
* for details.
*/

namespace Mike42\Escpos\Devices;

use Mike42\Escpos\Printer;
Expand Down
Loading

0 comments on commit 10b1230

Please sign in to comment.