1
votes

I have thermal printer Black Copper BC-85AC I am trying to connect it with php here is script I am using from https://github.com/mike42/escpos-php

I tried as testing:

require 'autoload.php';
use Mike42\Escpos\PrintConnectors\FilePrintConnector;
use Mike42\Escpos\Printer;
$connector = new FilePrintConnector("php://stdout");
$printer = new Printer($connector);
$printer -> text("Hello World!\n");
$printer -> cut();
$printer -> close();

I there any settings I have to do before running this script through browser ? Printer is attached with the system through USB I tried a test print through computer manually and it is working but I want to print through browser using this php script.

1
I either don't understand your question, or your question is if you can run this code. Just run it? It will print errors if there are. I would recommend printing only an empty page though, just in case the printer decides it needs new ink.Loek
There is no error when I running this script. Showing blank page and there is no print thoughGamesPlay
Put your logs in debug and let us know if you see anything in there.Nic3500

1 Answers

1
votes

I just found the solution actually I just have to replace:

$connector = new WindowsPrintConnector("My Printer Name Here");

and it is working fine.