mike42 / escpos-php

PHP library for printing to ESC/POS-compatible thermal and impact printers
Other
2.54k stars 862 forks source link

Message: copy(\\192.168.3.137\EPSON TM-U220 Receipt): failed to open stream: Permission denied #888

Open samsularifin05 opened 4 years ago

samsularifin05 commented 4 years ago

what is the solution? I use ubuntu server framework CodeIginiter,

`public function index(){

$this->load->library('escpos');
$ip = '192.168.3.137'; // IP Komputer kita atau printer lain yang masih satu jaringan
    $printer = 'EPSON TM-U220 Receipt'; // Nama Printer yang di sharing
    // membuat connector printer ke shared printer bernama "printer_a" (yang telah disetting sebelumnya)
    $connector = new Escpos\PrintConnectors\WindowsPrintConnector("smb://" . $ip . "/" . $printer);
    $printer = new Escpos\Printer($connector);
    $printer->initialize();
    $printer->text("Ini teks biasa \n");
    $printer->text("\n");
    $printer->close();
}`
samsularifin05 commented 4 years ago

I changed the code to something like this

`public function index(){

$this->load->library('escpos');
$ip = '192.168.3.137'; // IP Komputer kita atau printer lain yang masih satu jaringan
    $printer = 'EPSON TM-U220 Receipt'; // Nama Printer yang di sharing
    // membuat connector printer ke shared printer bernama "printer_a" (yang telah disetting sebelumnya)
           $connector = new Escpos\PrintConnectors\WindowsPrintConnector("smb://root:screet@192.168.3.137/EPSON TM-U220 Receipt");
    $printer = new Escpos\Printer($connector);
    $printer->initialize();
    $printer->text("Ini teks biasa \n");
    $printer->text("\n");
    $printer->close();
}`
samsularifin05 commented 4 years ago

error image

Adetiya21 commented 2 years ago

Did you solve that problem? I've same issue