mike42 / escpos-php

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

Printing to client network printer #1023

Open shyamsamtan opened 3 years ago

shyamsamtan commented 3 years ago

Hello mike, I am trying to print receipt for individual client from their own system to their network connected printer. My site is hosted in linux server and the client pcs can be either windows or linux. I tested in local network both in windows. Can you give me some code snippets? And I have tested in "BIXOLON SRP-332II" pos printer.

My code for testing "Hello World!" is: $connector = new WindowsPrintConnector("smb://192.168.1.104/posprinter"); $printer = new Printer($connector); $printer -> text("Hello World!\n\n"); $printer -> cut(); $printer -> close();

tecnoher commented 2 years ago

Hi, I solved it throw dyndns, I set up my DNS as IP on the network connection string, and in the network router I did a forward from port 9100 to the thermal printer IP. Hope this helps some