2

I was trying to print my receipt in my browser coming from the server. I am using windows server and I able to access it using a virtual box. I tried this code $connector = new WindowsPrintConnector("smb://mycomputername/posprinter"); . It would produce an error since the server is restricted hence it would not see my computer in server's networks. Is there another way to be able to print the receipt from my web browser which my web is deployed in the windows server. In my windows server, I am using XAMPP

Code in my Laravel Controller

    $connector = new WindowsPrintConnector("smb://mycomputername/posprinter"); 
    $printer = new Printer($connector);
    $printer->text("Hello World\n");
    $printer->cut();
    $printer->close();
boldsinas101
  • 300
  • 2
  • 5
  • 22
  • Have you tried `Ctrl+P`? – Sherif Feb 20 '20 at 06:43
  • No. I don't need to try `Ctrl+P` because in my system using that plugin after you click create, it would print the receipt. I will edit my question and display the code so you'll understand. Of course, if you would try `Ctrl+P`, it would set to the default printer which is the POS printer. – boldsinas101 Feb 20 '20 at 06:52
  • 1
    The server cannot see the browser. You likely need to use JavaScript to print the content you want from the browser-side. – ADyson Feb 20 '20 at 07:24
  • Okay so I need another blade file where my JavaScript code store – boldsinas101 Feb 20 '20 at 08:30

0 Answers0