Postingan lainnya
PHP printer
Ada yang pernah pake PHP printer di Framework ci ?
0
2 Jawaban:
Sudah coba dengan Library ESC/POS ? Link: [link]https://topidesta.wordpress.com/2017/05/08/trick-menambahkan-library-escpos-di-codeigniter/ [/link]
$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";
}
Source : 1. https://github.com/RSUP/ESC-POS 2. https://github.com/mike42/escpos-php/tree/master
1
Sebenarnya sudah berhasil cetak langsungnya tanpa pake library escpos. Tapi saya mau cetak yang di panggil di $this->load->view(nama_file);
0