Git Product home page Git Product logo

esc-pos's Introduction

ESC-POS-CODEIGNITER

ORIGINAL FROM: https://github.com/mike42/escpos-php/tree/master

STEP:

  1. Download all files in this github or the source
  2. Put the folder of all Mike42 to third_party
  3. Create File in libraries folder, with EscPos.php
  4. And run!

Example:

try {
    // Enter the device file for your USB printer here
    // You can check the tutorial here: https://mike42.me/blog/2015-03-getting-a-usb-receipt-printer-working-on-linux
    $connector = new FilePrintConnector("/dev/usb/lp0");
    /* Print a "Hello world" receipt" */
    $printer = new Printer($connector);
    $printer -> text("Hello World!\n");
    $printer -> cut();
    /* Close printer */
    $printer -> close();
} catch (Exception $e) {
    echo "Couldn't print to this printer: " . $e -> getMessage() . "\n";
}

More: https://mike42.me/blog/2015-03-getting-a-usb-receipt-printer-working-on-linux

Notes:

  1. Login as Root
  2. Write: chown -R user:user /dev/usb
  3. As alternatif if, sudo usermod -a -G lp user NOT WORKING!

This Is in Codeigniter!

$this->load->library("EscPos.php");

try {
		// Enter the device file for your USB printer here
	  $connector = new Escpos\PrintConnectors\FilePrintConnector("/dev/usb/lp0");
		   
		/* Print a "Hello world" receipt" */
		$printer = new Escpos\Printer($connector);
		$printer -> text("Hello World!\n");
		$printer -> cut();

		/* Close printer */
		$printer -> close();
} catch (Exception $e) {
	echo "Couldn't print to this printer: " . $e -> getMessage() . "\n";
}

Star History

Star History Chart

Done!

More info: topidesta.wordpress.com

esc-pos's People

Contributors

mdestafadilah avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

esc-pos's Issues

Hola, tu ayuda con codeigniter

tengo problemas con imprimir un logo, no puedo hacer funcionar EscposImage en codeignater, algo estoy pasando por alto

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.